Jump to content

Archived

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

RichE

image upload script stopped working

Recommended Posts

Hello, I have a weird problem. I have a script that uploads and image to a specified directory as well as a few other things, but a month ago it stopped working! No changes have been made to the file, but it doesn't work anymore! It may work once and a while, but most of the time it will not upload.

The upload script is in a /upload directory and is uploading to /images/reviews
Here is my code (filep is my upload form box name):
[code]
$folder = "../images/reviews/";
move_uploaded_file($_FILES["filep"]["tmp_name"] , "$folder".$_FILES["filep"]["name"]);
chmod("$folder".$_FILES["filep"]["name"],0644);
echo "<p align=center>File ".$_FILES["filep"]["name"]." uploaded.<br />";
[/code]

I did try copy instead of move_uploaded_file, but it still did not work. This time I added error outputs, but nothing happened.:
[code]
$folder = "../images/reviews/";
copy ($_FILES['filep']['tmp_name'] , "$folder".$_FILES['filep']['name']) or die ("Could not copy");
chmod("$folder".$_FILES["filep"]["name"],0644);
echo "<p align=center>File ".$_FILES["filep"]["name"]." uploaded.<br />";
[/code]

Can anyone see something wrong? It should work because it worked for MONTHS before it stopped working!

Thank you for your time.

Share this post


Link to post
Share on other sites
Even if someone can confirm that the code is OK that would be great. I just need some feedback, ANY feedback.

Thanks

Share this post


Link to post
Share on other sites
Here is the form.
[code]
<form action=reviewupload.php method=post enctype="multipart/form-data">
<table border="0" cellspacing="0" align=center cellpadding="3" bordercolor="#cccccc">
<tr>
<td>Title:</td>
<td><input type="text" name="Title" size=30 maxlength="200"></td>
</tr>
<tr>
<td>Release Date:</td>
<td><input type="text" name="Release_Date" size=30 maxlength="35"></td>
</tr>
<tr>
<td>Rating:</td>
<td><input type="text" name="Rating" size=30 maxlength="10"></td>
</tr>
<tr>
<td>Runtime:</td>
<td><input type="text" name="Runtime" size=30 maxlength="3"></td>
</tr>
<tr>
<td>Director:</td>
<td><input type="text" name="Director" size=30></td>
</tr>
<tr>
<td>Writer:</td>
<td><input type="text" name="Writer" size=30></td>
</tr>
<tr>
<td>Studio:</td>
<td><input type="text" name="Studio" size=30 maxlength="100"></td>
</tr>
<tr>
<td>Staring:</td>
<td><input type="text" name="Staring" size=30></td>
</tr>
<tr>
<td>Reviewer:</td>
<td><input type="text" name="Reviewer" size=30 maxlength="10"></td>
</tr>
<tr>
<td>Picture:</td>
<td><input type="file" name="filep" size=30></td>
</tr>
<tr>
<td>Description:</td>
<td><textarea cols="30" rows="7" name="Description"></textarea>
</td>
</tr>
<tr>
<td>Final Comments:</td>
<td><textarea cols="30" rows="7" name="Final_Comments"></textarea>
</td>
</tr>
<tr>
<td>Rating:</td>
<td><input type="text" name="Rating" size=30 maxlength="3"></td>
</tr>
<tr>
<td colspan=2><p align=center>
<input type=submit name=action value="Load">
</td>
</tr>
</table>
</form>
[/code]

Thanks!

Share this post


Link to post
Share on other sites

×

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.