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?? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.