/    Sign up×
Community /Pin to ProfileBookmark

file not found

I have a form on my website to upload files to the server. I uploaded several files this morning when I suddenly got a “Page not found” error. I would select a file and click submit, wait a few seconds and then the file not found page shows up. So I checked to see if the file was still there. It is. The file size limit is set at 2000 KB and the files I am uploading are only 200KB. I have no idea how to troubleshoot this. I thought the problem would have to be in the session headers but they are very simple, just session_start(); and have worked for months. I contacted the webserver technicians and asked if there were limits to the file space on the server but there is plenty of room. I asked if they had changed permissions or modified the php setting but nothing has been changed.

Any ideas would be appreciated.
PS. What is the best medication for PHP headaches?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroOct 07.2003 — Hmm... sounds odd.. Could we see the script? Also, make sure the permissions of the directory that the script uses to store the images is still writeable.

As far as what to use for PHP headaches, try [URL=http://us2.php.net/manual/en/function.sleep.php]sleep()[/URL]... :p
Copy linkTweet thisAlerts:
@kanuskiauthorOct 07.2003 — I thought I figured out the problem. A friend of mine tried it and it worked on his computer. So there was a problem on my end. Something that changed while I was working...? Temporary internet files! I deleted temp files and it worked! twice! Now I cannot get it to work again.

Anyways, here is the code.

<?

session_start();

?>

<html>

<head>

<title>Enter Image Information:</title>

</head>

<body bgcolor="#FFFFcc" text="#000000">

<?

if($uploadedfile=="none")

{

echo "<center><h2>Sorry:</h2> <p><font size=5>The server is unable to accept uploads at this time.</font></center>";

//first_mail.php

$mail_to = "[email protected]";

$mail_subject = "Digital Saskatchewan upload error message";

$mail_body = "Dear Digital Saskatchewan nn Someone is having a problem uploading images to Digital Saskatchewan. n";

$headers = "From: the Boss";

mail($mail_to, $mail_subject, $mail_body);

echo "<center><p>This error has been reported to Digital Saskatchewan and will be resolved ASAP.";


echo "<META HTTP-EQUIV='Refresh' CONTENT='4;URL=start.php'>";
EXIT;
}


?>

<P>

<center><font size=4>Online Submissions Form</font><br>

<font size=6>Step #3b: Enter File Information.</font>

</center><p>

<table align=center border=1 cellpadding=15 width="95%">

<tr><td>

<P align=center>

<?

$path3=stripslashes("$path");


// Add the file extension to the filename

$extinfo = explode(".", $path3);

$format=$extinfo[1];

$format=strtolower($format);

$ext=".$extinfo[1]";

$ext=strtolower($ext);

if($ext==".rm")
{ $ext=".ram"; }
if($ext==".jpeg")
{ $ext=".jpg"; }
if($format=="jpg" OR $format=="gif" OR $format=="png")
{

$imagehw = getimagesize($uploadedfile);

$imagewidth = $imagehw[0];

$imageheight = $imagehw[1];

}


if($ext == ".jpg" OR $ext == ".gif" OR $ext == ".png" OR $ext == ".wav" OR $ext == ".wmv" OR $ext == ".jpeg" OR $ext == ".mpeg" OR $ext == ".swf" OR $ext == ".jpeg" OR $ext == ".avi" OR $ext == ".ram" OR $ext == ".mid" OR $ext == ".mov" OR $ext == ".ra")
{
}
else
{
echo "<br>Extension: $ext<p>";
echo "<META HTTP-EQUIV='Refresh' CONTENT='0;URL=add.php?ext=bad&path=$path'>";
EXIT;
}
$filename=$filename.$ext;

?>

I have an html form here for adding info about the file.

<?

$entries++;

include ("connect.php");

mysql_query ("UPDATE contributors SET

entries='$entries'

WHERE subid=$subid

");

copy($uploadedfile, "/var/www/subsites/ischool/digitalsask/imagetemp/$subid/$filename")

?>

<p>&nbsp;</p>

</body>

</html>
Copy linkTweet thisAlerts:
@pyroOct 07.2003 — The temporary files were probably just because the page didn't reload. It shouldn't be a problem for other users who should receive the correct version.
×

Success!

Help @kanuski spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...