SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 11th, 2004, 05:33 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Multi-upload not going working

I have been trying to run a multiple upload script, but I'm having trouble getting it to work.

Here is the code...
I think one problem is Where I am trying to copy the files. It worked when I just had a simple single upload script.


* This is the first page, the number of upload possibilities is set at 5.

PHP Code:
<?
//start the form
$uploadNeeded 5;
for (
$x=0$x<$uploadNeeded;$x++) {
?>
<input name="uploadFile <? echo $x?>" type="file" id="uploadFile <? echo $x?>"> 
</p>
<?
//end of for loop
}
?>
<p>
<input name="uploadNeeded" type="hidden" value="<? echo $uploadNeeded?>"> 
<input type="submit" name="Submit" value="Upload">
</p>
</form>

* This is the second page that uploads the first form.
PHP Code:
 $uploadNeeded $_POST'uploadNeeded'];
// start for loop
for($x=0$x<$uploadNeeded$x++){
$file_name $_FILES['uploadFile'$x]['name'];
//strip file name of slashes
$file_name stripslashes($file_name);
$file_name str_replace("'","",$file_name);
$copy copy($_FILES['uploadFile'$x]['tmp_name'], "../uploadworkfolder/"$foldername"/"$file_name);
//check if successfully copied
if($copy) {
echo 
"$file_name | uploaded successfully!<br>";
} else {
echo 
"$file_name | could not be uploaded, check file name and kind.<br>";
}

//end of loop 


The $copy line may the be problem, I can't seem to copy to that dir.

This script was modified from Johnathan's script.
Any help appreciated.
R.
__________________
bow wow!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Multi-upload not going working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway