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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.