Jump to content

[SOLVED] uploading & troubleshooting


Andrei

Recommended Posts

Hi,

 

I'm using the following code on my site to upload files. It's been working fine until now. I keep getting "Error Msg 2" (see below).

 

What could be causing it? I don't even know where to begin troubleshooting!

 

<?php

$target = "/home/folder01/";

$target = $target . basename( $_FILES['uploaded']['name']) ;

$ok=1;

 

if ($uploaded_size > 350000000)

{

echo "Your file is too large.<br>";

$ok=0;

}

 

if ($uploaded_type =="text/php")

{

echo "No PHP files<br>";

$ok=0;

}

 

if ($ok==0)

{

Echo "Error Msg 1";

}

 

else

{

if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))

{

echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded. <a href=./>Click here</a> to return.";

}

else

{

echo "Error Msg 2";

}

}

?>

Link to comment
https://forums.phpfreaks.com/topic/149054-solved-uploading-troubleshooting/
Share on other sites

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.