Skip to content
Advertisement

How to direct the uploaded image to the file i want

i’m asking user to input the image as;

JavaScript

Then i am storing that data into my database with the following;

JavaScript

And then i am listing the files and the image i get from the user in the function below;

JavaScript

However when user uploads the image,i want it to upload the image into my C:xampphtdocsea file.

Tried this Storing images in MySQL couldn’t do it properly.Appriciated for the help.

Advertisement

Answer

you must set the enctype in form like this to upload the file

JavaScript

to access the uploaded file in the action page you need to do this instead of your code

JavaScript

Use $_FILES to get file data

JavaScript

upload the file to your destination if you want to upload the file in C:xampphtdocsea folder. If your form file exists in this format then use below code htdocs- ea (your image path) yourfoldername – -form.php (your form)

JavaScript

after file upload save the data to database

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement