0
votes

I'm using laravel to upload an mp3 file to a folder.

I must do it with an API so I can't use a form for it. I created an UploadController and resource route that belongs to it. Deleted other methods except store. Also I must get two parameters with it.

I can get only mp3 file, not other parameters. Is there a better way to handle multipart request?

1
If what you need is to upload a file asynchronously you can use dropzonejs.com, if that's not the case you can encode your mp3 file to base64, which means it will be a plain text string and can be used as a parameter on your upload controller with base64_decode and save that content to a file - Sergio Guillen Mantilla

1 Answers

0
votes

I don't seem to understand the problem.

If you have a form you use to upload the file, then just add two new inputs representing those two parameters you also want to have. You will then be able to get them from the controller.