Jump to content

PDF Upload Issue


phpretard

Recommended Posts

I am trying to upload a pdf to my DB.

 

This is all I get...

 

Warning: fread(): supplied argument is not a valid stream resource

 


//HERE'S THE FORM

<form method="POST" action="process.php" enctype="multipart/form-data" style="width: 200"> 

Doc Name: 
<input type="text" name="form_description" size="40"> 
<input type="hidden" name="MAX_FILE_SIZE" value="256000"> 
File to upload: 
<input type="file" name="form_data" size="40"><br>
<input type="submit" name="submit" value="submit"> 
</form>

//HERE'S THE UPLOAD SCRIPT

$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data))); 

$result=MYSQL_QUERY("INSERT INTO members (description, data,filename,filesize,filetype, date) 

VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type', '$date')");

$id= mysql_insert_id(); 

print "<p>File ID: <b>$id</b><br>"; 
print "<p>File Name: <b>$form_data_name</b><br>";
print "<p>File Subject: <b>$Subject</b><p>"; 
print "<p>File Size: <b>$form_data_size</b><br>"; 
print "<p>File Type: <b>$form_data_type</b><p>"; 

 

Any help tonight please??

Link to comment
https://forums.phpfreaks.com/topic/97185-pdf-upload-issue/
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.