How to upload a file without using a form with Ajax

preview_player
Показать описание
In this video we are going to send a file to the server without
the use of a form element.
We are going to use the FormData object in Javascript,
and an Ajax request to send a file to the server.
And from there we are going to use php to save it in a folder.

I also have an article on my website which you can read:

If you feel like saying thanks, you can buy me a coffee ❤️.

Thank you guys for your support.
Комментарии
Автор

Simple to follow, the best tutorial I was able to find for my need (thanks) - I have a question regarding the example: How do I capture the ".then((data) =>" to a text string? Searched for a very long time but could not find a working solution.

izxiljb
Автор

Great tutorial, thank you. I suggest revising the title to: "How to upload a file with Ajax without using a form"

HDITrae
Автор

Great video but i have some issues concerning the filereader object that i can not understand when we are doing a file upload.

tiagoborges