FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 26th, 2004, 03:23 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,643 jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 3 Days 18 h 37 m 28 sec
Reputation Power: 1591
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
File exists stops ftp upload

Hi,

This has been driving me nuts. Spent a couple of hours on this, can't seem to figure it out. Maybe a fresh pair of eyes will help

Anyway, I am amending an mulitple file upload script that I have been using previously. What I am trying to do is to give messages after each file that I upload, eg:
  • Upload successful
  • File exists
  • File was empty
Now I have managed to get the multiple empty files to echo the messages correctly, but if I have 1 file that already exists, it gives the files exists message to every file I have uploaded, the empty ones are still given the message "empty".

Here is a snip of my code. I hope someone can figure out what is probably a really elementary mistake. Thanks in advance..
PHP Code:
/* The script connects and uploads OK, it just stops when there is 1 file existing already
   $full_dir is just the url of the directory where the files are being uploaded to
   Sample of the form input type:
    <input type="file" name="upfile[]" />
*/
$message '';
$the_upload '';
$res_code '';
for (
$x=0$x<sizeof($_FILES['upfile']); $x++):
    if (empty(
$_FILES['upfile']['name'][$x])):
    
$message .= 'Upload '. ($x+1) .' was empty!<br />';
    else:
        if (
fopen($full_dir $_FILES['upfile']['name'][$x], 'r') == TRUE) :
        
$message .= 'File exists!<br />';
        else:
        
$res_code .= @ftp_put($result$_FILES['upfile']['name'][$x], $_FILES['upfile']['tmp_name'][$x], FTP_BINARY);
        
$message .= $res_code == TRUE  'File '. ($x+1) .' uploaded successfully!<br />' 
        
'Upload error!<br />';
        endif;
    endif;
endfor; 
__________________
Cheers,

Jamie


# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

# Any form of employment is strictly prohibited ......


__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.

__________________

Reply With Quote
  #2  
Old March 26th, 2004, 06:08 PM
Keiichi Keiichi is offline
aHVoPw==
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,058 Keiichi User rank is Lance Corporal (50 - 100 Reputation Level)Keiichi User rank is Lance Corporal (50 - 100 Reputation Level)Keiichi User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 24 m 31 sec
Reputation Power: 9
I can't find the problem. Could perhaps the line:
$res_code .= @ftp_put(...
cause it, because of the concantenation .=? Which might cause $res_code to do something. I'm not sure what happens if you concantenate two booleans.
__________________
K1

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > File exists stops ftp upload


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 | 
  
 





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