This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
support:dispatch:pdf_testing [2017/12/07 14:44] smileyd |
support:dispatch:pdf_testing [2017/12/11 10:16] (current) smileyd |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <html> | + | <a href="file.pdf">downloadPDF</a> |
| - | + | ||
| - | <head> | + | |
| - | + | ||
| - | <title>A simple example of uploading a file using PHP script</title> | + | |
| - | + | ||
| - | </head> | + | |
| - | + | ||
| - | <body> | + | |
| - | + | ||
| - | <b>Simple example of uploading a file</b><br /> | + | |
| - | + | ||
| - | Choose a file to be uploaded<br /> | + | |
| - | + | ||
| - | <form action="upload_file.php" method="post" enctype="multipart/form-data"> | + | |
| - | + | ||
| - | <input type="file" name="file" size="50" /> | + | |
| - | + | ||
| - | <br /> | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | </form> | + | |
| - | + | ||
| - | </body> | + | |
| - | + | ||
| - | </html> | + | |
| - | + | ||
| - | $targetfolder = "testupload/"; | + | |
| - | + | ||
| - | $targetfolder = $targetfolder . basename( $_FILES['file']['name']) ; | + | |
| - | + | ||
| - | if(move_uploaded_file($_FILES['file']['tmp_name'], $targetfolder)) | + | |
| - | + | ||
| - | { | + | |
| - | + | ||
| - | echo "The file ". basename( $_FILES['file']['name']). " is uploaded"; | + | |
| - | + | ||
| - | } | + | |
| - | + | ||
| - | else { | + | |
| - | + | ||
| - | echo "Problem uploading file"; | + | |
| - | + | ||
| - | } | + | |
| - | + | ||