phpretard Posted March 21, 2008 Share Posted March 21, 2008 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 More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 where are u getting this great variable $form_data Link to comment https://forums.phpfreaks.com/topic/97185-pdf-upload-issue/#findComment-497301 Share on other sites More sharing options...
phpretard Posted March 21, 2008 Author Share Posted March 21, 2008 What should it be? ps. Can I see you modular CMS system? Link to comment https://forums.phpfreaks.com/topic/97185-pdf-upload-issue/#findComment-497305 Share on other sites More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 well if you want the actual data you need to look into the super global array $_FILES Link to comment https://forums.phpfreaks.com/topic/97185-pdf-upload-issue/#findComment-497458 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.