Testing mysql_upload_file()

The files dont seem to be uploaded (although the upload path should be /home/users/web/b2019/moo.shoresrentalscom/)
But nothing seemed to get uploaded, so I tried to figure out why, ran this script

<script language="javascript" type="text/javascript">
function getPath() {
 var inputName = document.getElementById('file1');
 var imgPath;

 imgPath = inputName.value;

to see and I get screenshot, where does that value come from?

It comes from what the field ‘file1’ defines as it’s current value.

Without context, that’s as much as i can tell you.

thanks, the form is at
The part thats confusing to me is what does the C;\fakepath\ mean

When trying to upload an image, in PHP is you do a var_dump on the $_FILES array what do you get?

if I do


I get
{ [“images”]=> array(5) { [“name”]=> string(0) “” [“type”]=> string(0) “” [“tmp_name”]=> string(0) “” [“error”]=> int(4) [“size”]=> int(0) } }
swhich looks to me like its not even being seen? Shouldn’t there be some stuff for each of the values?

however, when I do

for($i = 0; $i < count($_FILES['images']['name']); $i++)
   echo $_FILES['images']['name'][$i] . "<br>";
   echo $_FILES['images']['type'][$i] . "<br>";
   echo $_FILES['images']['size'][$i] . "<br>";
   echo $_FILES['images']['error'][$i] . "<br>";

I get,

That woulld be impossible if executed in the same time. Put BOTH pieces of code in and see what you get.

in my html form each inputs name was images, I changed each name to images and that seemed to work, when I looked on the server I noticed the folders permissions were still 755, but the image has been uploaded.

but in the $upload_dir, I got rid of the stupid /public_html
so I guess the value in my php.info file is the path to the documents root.
On another server I had to add the /public_html. (what a pain)

You… are probably hardcoding a directory string that you should not be.

So instead of hard coding the upload directory, how do I instead use a php constant, I thought there was a constant to use, but couldn’t figure out how to find that

check the contents of


thanks, that was it