Add support for PUTting files
See original GitHub issueI wanted to PUT files on my server using express and multer but after some hours I resigned - it’s not possible, is it? (see http://stackoverflow.com/questions/33976006/multer-wont-recognize-files-with-put)
app.put('/upload/:file', upload.any(), function (req, res, next) {
console.log('files: ' + req.files);
console.log(req.params.file);
res.send('got that');
})
IMO this should work. It should accept whatever file I PUT. It shouldn’t be much work to add support for this, I think. I’ll take a look at the sources; maybe I can file a PR.
P.S.: How can I accept any path that comes with PUT? Something like app.put('^/.*$', ...)
or app.put('^/.+$', ...)
.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Upload and share files - Microsoft Support
Try it! Upload and share files to work with others in Microsoft Teams. Attach a file from a channel. In a channel, under...
Read more >Add files and folders to shared drives - Google Support
On the left, click a shared drive or existing folder. Click New "" and then Folder. Enter a folder name and click Create....
Read more >Organize files in folders on Mac - Apple Support
In the Finder on your Mac, organize files in folders. As you create documents, install apps, and do other work, add new folders...
Read more >Adding support resources to your project - GitHub Docs
To direct people to specific support resources, you can add a SUPPORT file to your repository's root, docs , or .github folder.
Read more >Upload to Box With the File Browser - Box Support
In the All Files section, click New + button in the upper-right corner. · Select File Upload or Folder Upload, depending on what...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Multer does support
PUT
, as noted in the answer on stack overflow, the problem is that your curl call is sending the raw file, not amultipart/form-data
. The following call should work for you.If you want to accept raw boides instead, which is another use case and thus isn’t covered by multer, you could use
body-parser
. Have a look at theraw
function.No problem, discussion is always good 👍