I’m currently trying to upload a csv file to a database through simple html and then php. My problem is I like to know how things work/what’s actually happening (I guess that’s why I have so many questions)
So anyway my HTML is as follows:
<html>
<form action="mysite.php" method="POST">
<input type="file" name="file"><br />
<input type="submit" value="Now upload it!">
</form>
</html>
My PHP is just:
<?php
echo 'Success';
?>
Before I actually store the file in a database of my liking where is the file actually stored?
Is it created as a temp file on the server?
Saved on the server ram?
Does it not actually do anything since it’s not told to do anything (aka: save to DB)
Thanks
Yes it would be in a temp file on the server but in your case it wouldn’t because you missed the encoding type :
Here’s the manual on file uploading php file uploading
You can see what is uploaded by doing a var_dump($_POST) for variable names and var_dump($_FILES) for file data to help understand.
As you can see in the reference once the file is uploaded you need to move it from its temp location to its final destination.