Replies: 1 comment 3 replies
-
The same code you posted seems to work for me, and is able to extract the filename from a
Can you provide more details of your issue, in particular what format/library/API are you using to upload the form? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
first let me say I really enjoy learning rocket!
I am new to web development, so if this is not a rocket question please forgive me:
I am trying to upload a file to my server (post request, currently trying
enctype="multipart/form-data"
). The server should be able to check the filename and size before taking further action.Copying the approach that is described in Pastebin section of the guide lets me save the file on my sever, but the filename gets lost.
So currently I am trying to use a form guard that is wrapping a
TempFile
. ThatTempFile
unfortunately also does not give me access to the filename and I cannot even access the body of the post request.So here is my code:
I am using
rocket::form::Form<TempFile< >>
because the debug output of rocket suggested to do so, when I was only using TempFile. But now I still get said output:Can anyone help me with this?
Beta Was this translation helpful? Give feedback.
All reactions