lecture5 - CPSC431 Lecture 5 Handling File Uploads <form

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CPSC431 Lecture 5 Handling File Uploads <form action="uploadmanager.html" enctype="multipart/form-data" method="post"> Name:<br /> <input type="text" name="name" value="" /><br /> Email:<br /> <input type="text" name="email" value="" /><br /> Homework:<br /> <input type="file" name="homework" value="" /><br /> <p> <input type="submit" name="submit" value="Submit Homework" /></p> </form> File upload directives file_uploads (boolean) max_execution_time (integer) memory_limit (integer)M upload_max_filesize (integer)M upload_tmp_dir (string) post_max_size (integer)M The $_FILE Array $_FILES['userfile']['error'] $_FILES['userfile'][name'] $_FILES['userfile'][type'] $_FILES['userfile'][size'] $_FILES['userfile'][tmp_name'] File upload related functions boolean is_uploaded_file(string filename ) <?php If (is_uploaded_file($_FILES['classnotes']['tmp_name'])) { copy($_FILES['classnotes']['tmp_name'], "/home/profs/wang/classnotes/".$_FILES['classnotes'] ['name']); } else { echo "<p>Potential script abuse attempt detected.</p>"; } ?> File upload example HTML Form <form action="uploadmanager.php" enctype="multipart/form-data" method="post"> Last Name:<br /> <input type="text" name="name" value="" /><br /> Class Notes:<br /> <input type="file" name="classnotes" value="" /><br / > <p><input type="submit" name="submit" value="Submit Notes" /></p> </form> File upload example PHP script...
View Full Document

This note was uploaded on 11/20/2009 for the course CPSC CPSC431 taught by Professor Prf.wang during the Spring '09 term at CSU Fullerton.

Page1 / 17

lecture5 - CPSC431 Lecture 5 Handling File Uploads <form

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online