Jump to content

image upload script stopped working


RichE

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.
Link to comment
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!
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.