NyllRE / nuxt-file-storage

Easy solution to store files in your nuxt apps. Be able to upload files from the frontend and recieve them from the backend to then save the files in your project.
https://nuxt.com/modules/nuxt-file-storage
MIT License
74 stars 10 forks source link

How to handle upload directly from Postman? #28

Open BayBreezy opened 5 days ago

BayBreezy commented 5 days ago

Hello,

I was trying out the package earlier but was having difficulties getting an upload from Postman to work.

Is there an example anywhere of uploading files directly from an external source(Not the nuxt frontend)?

Or is it a case where we have to use the files from the frontend of the nuxt app?

NyllRE commented 5 days ago

are you sure that you're sending the files in Base64? If you're not sure check out the code for the fileInputHandler composable

BayBreezy commented 5 days ago

No. Postman sends the file as is. So I have access to the regular properties that are available when a file is uploaded to a server. In Nuxt 3, the readMultipartFormData utility gives me access to the file Buffer.

Do i need to convert said buffer to a base64 string?

NyllRE commented 5 days ago

yes, the files are currently being uploaded with Base64, I will add more settings to allow users to alternate between MultipartFormData and Base64

NyllRE commented 3 days ago

Hey, if it worked for you please let me know and if it worked please close this issue, thanks!