hi guys, i have my upload.php, now the problem is that it does not download pdf files, it says that there is a problem with regards to the uploading.

can you help me??? thanks in advance...

Recommended Answers

Hi there, can you post your upload.php file so that we could take a look at it?

Jump to Post

All 4 Replies

Hi there, can you post your upload.php file so that we could take a look at it?

this is the code sir

echo"<form enctype='multipart/form-data' action='fileRecs.php' method='POST'>";
echo "<input type='hidden' name='MAX_FILE_SIZE' value =1000000/>";
echo "Choose a file to upload: <input name='uploadedfile' type='file' /><br />";
echo "<input type='submit' name ='upload2' value='Upload File' /></form>";

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
$nameFile =  basename( $_FILES['uploadedfile']['name']);
Member Avatar

XX - I think we'll need a bit more than that.

Where's the contents of fileRecs.php? That's where your script is breaking down.

Also why all the php stuff at the bottom of the form? Personally I'd just leave the form as vanilla html:

<form enctype='multipart/form-data' action='fileRecs.php' method='post'>
  <input type='hidden' name='MAX_FILE_SIZE' value ='1000000' />
  <label for='uploadedfile'>Choose a file to upload:</label>
  <input name='uploadedfile' type='file' />
  <br /> 
  <input type='submit' name ='upload2' value='Upload File' />

What exactly is the error you're getting. Something about file not existing? If so, your destination is wrong. Perhaps it would help to include your virtual root at the start of your path: $path = $_SERVER['DOCUMENT_ROOT'] . '/uploads/'

i almost got it already, thanks thanks sir...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.