svenstaro / miniserve

🌟 For when you really just want to serve some files over HTTP right now!
MIT License
6.08k stars 294 forks source link

Can't Upload #1321

Open hqsone opened 9 months ago

hqsone commented 9 months ago

Start miniserve-0.26.0-x86_64-pc-windows-msvc.exe "d:\dt_cf" --port 8888 --upload-files

Tue, 16 Jan 2024 18:17:03 +0000 [ERROR] Failed to process multipart request
Tue, 16 Jan 2024 18:17:03 +0000 [ERROR] caused by: No Content-Type header found

Curl

C:\Users\user\Downloads\curl\bin>curl -F "path=@c:\Users\user\Desktop\AnyDesk.exe" http://localhost:8888/upload\?path\=/
<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="color-scheme" content="dark light"><link rel="icon" type="image/svg+xml" href="/e586aaecb4"><link rel="stylesheet" href="/5d876385d9"><title>405 Method Not Allowed</title>
                <script>
                    // updates the color scheme by setting the theme data attribute
                    // on body and saving the new theme to local storage
                    function updateColorScheme(name) {
                        if (name && name != "default") {
                            localStorage.setItem('theme', name);
                            document.body.setAttribute("data-theme", name)
                        } else {
                            localStorage.removeItem('theme');
                            document.body.removeAttribute("data-theme")
                        }
                    }

                    // read theme from local storage and apply it to body
                    function loadColorScheme() {
                        var name = localStorage.getItem('theme');
                        updateColorScheme(name);
                    }

                    // load saved theme on page load
                    addEventListener("load", loadColorScheme);
                    // load saved theme when local storage is changed (synchronize between tabs)
                    addEventListener("storage", loadColorScheme);
                </script>
            </head><body><div class="error"><p>405 Method Not Allowed</p><p>Request did not meet this resource's requirements.</p><div class="error-nav"><a class="error-back" href="/">Go back to file listing</a></div><p class="footer"><div class="version">miniserve/0.26.0</div></p></div></body></html>
hqsone commented 9 months ago

Also uploading doesn't work in web gui if autentification enabled