Support the ongoing development of Laravel.io →
Requests Input Installation
Last updated 3 months ago.
0

How are you sending it to Laravel ? file upload form post ?

0

I POST the entire string of the variable data mentioned above. And I am receving it in Laravel with Input::get() and not Input::file()

So it is basically a very long string received on the Laravel side too, do I need to decode it back to an image and save to a file path? If yes how do I do that?

Thanks very much

Last updated 6 years ago.
0

I do not see anything in the JavaScript that says you are encoding the data.

I think you will lose part of the unseen binary data if you use a standard form input string.

If you must use a string, then you will likely need to base64 encode the string on the JavaScript side then decode it on the Laravel side to save the data.

base64 is the safest way to transfer binary data if your not using the multi-part form upload.

You can decode it, then save it to a file or store it in a blob field in a db, or just save the string (though it will be larger than the decoded version)

0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.