| | |
Upload-file (Word.doc) in Dreamweaver
Please support our Graphics and Multimedia advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
In dreamweaver, create a new php file. Clear all of the code out of the code view. Now click toggle plain text, copy and paste all of the following into dreamweaver:
Name the above file uploader.php
Move the file to your server. In the same directory as the uploader.php file, create a new folder and name it files. Now go into your browser and test the uploader.php file.
php Syntax (Toggle Plain Text)
<?php if(isset($_POST['submit'])){ $numfilesuploaded = $_POST['numuploads']; $count = 1; while ($count <= $numfilesuploaded) { $conname = "new_file".$count; $filetype = $_FILES[$conname]['type']; $filename = $_FILES[$conname]['name']; if ($filename != '') { if ($filetype == "application/msword" || $filetype=="application/vnd.openxmlformats-officedocument.wordprocessingml.document") { $maxfilesize = $_POST['maxsize']; $filesize = $_FILES[$conname]['size']; if($filesize <= $maxfilesize ) { $randomdigit = rand(0000,9999); $newfilename = $randomdigit.$filename; $source = $_FILES[$conname]['tmp_name']; $target = "files/".$newfilename; move_uploaded_file($source, $target); echo $count." File uploaded | "; } else { echo $count." File is too big! 10MB limit! |"; } } else { echo " The file is not a supported type |"; echo $filetype; } } $count = $count + 1; } } ?> <?php $numuploads = 1; $count = 1; ?> <form action="<?php echo $_server['php-self']; ?>" method="post" enctype="multipart/form-data" id="something" class="uniForm"> <?php while ($count <= $numuploads) { ?> <input name="new_file<?php echo $count; ?>" id="new_file<?php echo $count; ?>" size="30" type="file" class="fileUpload" /> <?php $count = $count + 1; } ?> <input type = "hidden" name="maxsize" value = "10240000"> <input type = "hidden" name="numuploads" value = "<?php echo $numuploads; ?>"> <br> <button name="submit" type="submit" class="submitButton">Upload Files</button> </form>
Move the file to your server. In the same directory as the uploader.php file, create a new folder and name it files. Now go into your browser and test the uploader.php file.
•
•
Join Date: Jul 2008
Posts: 3
Reputation:
Solved Threads: 0
Many thanks, much appreciated. I will give it a go, but as said, my background in print design and not web. I've no problem creating static pages, but when it comes to the back-end stuff, I'm pretty much lost. As soon as I've got it going, I will ping you back. Creating a php file in Dreamweaver is pretty straight forward I guess? Regards.
![]() |
Other Threads in the Graphics and Multimedia Forum
- Previous Thread: how do i put up a video on my website so people can view it
- Next Thread: DashBoard
| Thread Tools | Search this Thread |
3d 10 actionscript3 adobe adobeacrobat adobereader air ajax amazon amf apple button cart childprotection cloud dashboard dell design dojofoundation dreamweaver ebay eclipse ecommerce elasticcomputecloud embed endorsement extra family flash flash-develop flashlite flex free harddrive iamthwee ibm illustrator imflash intel interactivemap javafx javascript laptop legal map micron microsoft mobile monitoringsoftware moonlight multimedia myspace nand news novell panorama pdf pedophiles photoshop photosynth php safety sandisk security shopping silverlight solidstatedrive sproutcore ssd streaming swf table ukmap unload unwanted video vulnerability web white.space xml zend zephyr zeroday





