Closed made1990 closed 4 months ago
ok, i studied curl's manual, and -d is for POST instead of PUT, or better, for "form" shaped data. It's not the plain file, it has a different structure.
Thx for checking.
-d
works fine if you put text content as input, e.g. -d "this is my input"
instead of uploading an already existing file
So after some additional testing I would say it works great :) and it would be great to have this feature in a stable hfs version at some point. One more slight request for that ;) Is it possible to let the user who uploads the file decide if the md5 checksum creation is triggered or not. E.g. with some information put in the HEADER when using the PUT command?
easy, after the "middleware" line you can add something like this
if (!ctx.get('x-request-md5')) return
or if you prefer to append in the URL ?get=md5
if (ctx.query.get !== 'md5') return
hopefully the stable version will arrive in 1 or 2 weeks.
i updated the wiki to use a more standard header for the md5
ctx.set({ 'Content-Digest': `md5=:${hasher.digest('hex')}:` })
it's functionally the same, but adhering to standards is often a good thing
Is it possible to get the md5 checksum of a file? Either directly after uploading (using PUT) as a return value or as part of an http GET using the api.