rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.13k stars 209 forks source link

Error when trying to POST upload #571

Closed vyachkoslav closed 5 months ago

vyachkoslav commented 5 months ago

When trying to upload a file using POST upload method from api using curl -F upload=@a.txt http://127.0.0.1/, server doesn't respond and returns this error in console:

uncaught: Error [ERR_METHOD_NOT_IMPLEMENTED]: The _write() method is not implemented
    at new NodeError (node:internal/errors:388:5)
    at Writable._write (node:internal/streams/writable:591:11)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at VolatileFile.write (C:\snapshot\hfs\dist\node_modules\formidable\dist\index.cjs:160:23)
    at Stream.<anonymous> (C:\snapshot\hfs\dist\node_modules\formidable\dist\index.cjs:1380:12)
    at Stream.emit (node:events:537:28)
    at MultipartParser.dataPropagation (C:\snapshot\hfs\dist\node_modules\formidable\dist\index.cjs:843:22)
    at MultipartParser.emit (node:events:549:35) {
  code: 'ERR_METHOD_NOT_IMPLEMENTED'
}

PUT upload works for me

Environment:

rejetto commented 5 months ago

thanks for reporting. the fix will be included in next release. anyway, be aware that what you'll get will just be an error, because you are uploading to a folder (the root) where you have upload permission. let me know if you need this fix urgently and i'll give you a preview version.

rejetto commented 5 months ago

published 0.52.4