Jump to content

file upload script wont work


megaman

Recommended Posts

I have been having difficulty getting a bit of script which uploads a file working

 

it looks like this

 

$image = basename( $_FILES['imageone']['name']);

$destination = "../../images/" . $image;

print($image);

 

(not that i am using print to see if the files name is being captured, this is the part which isnt working as nothing is printed

once i get it working i will change print to move_uploaded_file

 

the form which submits the file looks like this

 

<form action="write_scripts/updatestatic.php" method="post" enctype="multipart/form-data">

<textarea class="ckeditor" name="editor1"></textarea>

<input name="page" type="hidden" value="wholesale" />

 

<div style="width:450px; background-color:#F00;">

<div style="width:auto; background-color:#0F3; float:left;">

<div>pic 1<input name="imageone" type="file" /></div>

<div>pic 2<input name="imagetwo" type="file" /></div>

<div>pic 3<input name="imagethree" type="file" /></div>

<div>pic 4<input name="imagefour" type="file" /></div>

</div>

 

<div style="width:100px; height:100px; float:left; background-color:#000;"><img src="../images/positions.png" width="100" height="100" /></div>

</div>

 

<div>

<input name="Send" type="submit" value="Submit" /></div>

</form>

 

can anyone see why the file name is not getting passed

Link to comment
https://forums.phpfreaks.com/topic/274310-file-upload-script-wont-work/
Share on other sites

Take a look at the entire $_FILES array and see if it has what you expect.

 

Also, the "name" isn't entirely trustworthy. You should make sure it has a valid extension (I can't tell what you're uploading though), otherwise someone could upload a PHP script or something.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.