PHP,IIS,Uploads,files,user,works,perfectly,wi
Quick Search for:  in language:    
PHP,IIS,Uploads,files,user,works,perfectly,wi
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
PHP Stats

 Code: 70,122 lines
 Jobs: 9 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for PHP
iif() function
By Martin C. Conniffe on 8/16


Dynamic List of Specified Files
By nothing34543534 on 8/15


Active Users (No MySQL) UPDATED! BETTER!
By Brandon Sachs on 8/15


PassGen v 1 stable
By Bogomil Shopov on 8/15


toString v 1.0 b
By Bogomil Shopov on 8/15


Calculating factorials
By Daniel Destro do Carmo on 8/14


AcidicChip's MP3 ID3v2 Tag Writer 1.0
By Chance O. One on 8/14


Click here to see a screenshot of this code!user 2 user messenger 2
By Cornelius Herzog on 8/14

(Screen Shot)

htaccess
By Sven Wagener on 8/13


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Another way to Upload

Print
Email
 
VB icon
Submitted on: 3/3/2001 11:11:54 AM
By: Steve Oliver  
Level: Beginner
User Rating: By 5 Users
Compatibility:PHP 4.0

Users have accessed this code 11672 times.
 
(About the author)
 
     Uploads up to 5 files user PHP, works perfectly on win32 servers such as IIS or Apache for windows. Demonstrates the use of copy(), functions, and switch operators.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    //**************************************
    //     
    // Name: Another way to Upload
    // Description:Uploads up to 5 files use
    //     r PHP, works perfectly on win32 servers 
    //     such as IIS or Apache for windows. Demon
    //     strates the use of copy(), functions, an
    //     d switch operators.
    // By: Steve Oliver
    //
    // Inputs:$destination should be set to 
    //     where you want the files uploaded to.
    //
    //This code is copyrighted and has    // limited warranties.Please see http://
    //     www.Planet-Source-Code.com/xq/ASP/txtCod
    //     eId.285/lngWId.8/qx/vb/scripts/ShowCode.
    //     htm    //for details.    //**************************************
    //     
    
    <?
    function uploadProg($filename1,$filename1_name,$filename2,$filename2_name,$filename3,$filename3_name,$filename4,$filename4_name,$filename5,$filename5_name){
    ########Set the destination here##############
    $destination="C:\\Uploads\\";
    copy($filename1,$destination."/".$filename1_name);
    copy($filename2,$destination."/".$filename2_name);
    copy($filename3,$destination."/".$filename3_name);
    copy($filename4,$destination."/".$filename4_name);
    copy($filename5,$destination."/".$filename5_name);
    echo "<h1>File(s) Uploaded...</h1>";
    echo "<b>$filename1_name was uploaded succesfully.</b><br>";
    echo "<b>$filename2_name was uploaded succesfully.</b><br>";
    echo "<b>$filename3_name was uploaded succesfully.</b><br>";
    echo "<b>$filename4_name was uploaded succesfully.</b><br>";
    echo "<b>$filename5_name was uploaded succesfully.</b><br><br>";
    echo "<a href=\"upload.php\">Click here to go back.</a>";
    }
    function main(){?>
    <form method="post" action="upload.php" enctype="multipart/form-data">
    Files to Upload:<br>
    <input type="file" name="filename1" size="20" tabindex="1"><br>
    <input type="file" name="filename2" size="20" tabindex="2"><br>
    <input type="file" name="filename3" size="20" tabindex="3"><br>
    <input type="file" name="filename4" size="20" tabindex="4"><br>
    <input type="file" name="filename5" size="20" tabindex="5"><br>
    <input type="hidden" name="action" value="uploadProg">
    <input type="submit" value="Upload Files" tabindex="6">
    </form><?}
    switch ($action){
    default:
    main();
    break;
    case "uploadProg":
    if ($filename1=="none") {echo("<h1>No File Selected....</h1>"); break;}
    uploadProg($filename1,$filename1_name,$filename2,$filename2_name,$filename3,$filename3_name,$filename4,$filename4_name,$filename5,$filename5_name);
    break;
    }
    ?>


Other 4 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
6/27/2001 2:19:47 PM:Phil Essing
Thanks for the code, Steve!  It was 
very easy to customize and implement.  
I have one question, though:  will this 
upload module work with any file 
extention and size?  I ask this because 
the process always fails with large (2 
meg, for example) files.
Thanks 
again!
-phil
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/15/2001 6:11:11 PM:David Overcash
if the code fails to upload somthing, 
and it tends to show up with larger 
size files that could either be a 
setting by the server or there is not 
enough allocated memory on the server 
to complete a copy task of that size...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/9/2001 5:02:25 PM:caciola@estado.com.br
Hi,
I'm having one Warning message, 
please see above.
Warning: Undefined 
variable: action in 
C:\WebMaster3\Script\PHP\Another way to 
Upload.php on line 47
What do I do 
to fix this message ?
Thank's
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/25/2002 7:40:07 PM:Moumen
where can i paste this script please 
someone help me. please
i need to 
let users upload for me mp3s and 
download i have a server 24 hours daily 
open with 120 gigabyte.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/11/2002 12:54:55 PM:chris
i'm very new in php. So, I need to save 
this copy-and-paste code wherever is 
the name of file, isn't it? And how 
about the upload.php file in the 
form?
help me. just a beginner. tYou
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/26/2002 2:46:28 PM:Jeffrey Cook
I downloaded your "Another way to 
Upload" code and I can't get it to 
work. Should I have to install another 
module that works with your code? I get 
errors pertaining to undefined 
variables that you use in the form. The 
PHP code is not seeing those variables 
at all. Can you assist me please?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/8/2002 10:17:26 AM:kaiserm22@yahoo.com
Hi, I like u code it vvery nice and 
straight forward.
I am kinda new to 
php coudl u show me an example how i 
can upload file to through http to a 
remote server for example 
http.mydomain.com/tmp/.
thank a 
lot
my email kaiserm22@yahoo.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | PHP Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.