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:
  #1  
Old July 12th, 2002, 10:30 PM
chet horchem chet horchem is offline
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Pekin, IL
Posts: 4 chet horchem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to chet horchem
FTP Upload

I've been pouring over the following code all day, but can't seem to get it work. I appreciate anyone that can point out any errors.

PHP Code:
 $imageUpFile $_FILES['file']['tmp_name'];
    
$imageType $_FILES['file']['type'];
    
$imageName $_FILES['file']['name'];

    echo
" $imageUpFile, $imageType, $imageName";

    
    
//Open the uploaded pic (temp file)
    
if ($thePic fopen ($imageUpFile"rb"))
    {
         
//read temp file into var
        
$savePic fread($thePicfilesize($imageUpFile));
        
        
//Open a new file in the correct directory using the name of the uploaded pic file
        
if ($fileHandle fopen("ftp://username:apassword@somehost.com/htdocs/www/uploads/$imageName","w"))
        {
        
//Put data into just opened file pointer
        
if (fwrite ($fileHandle$savePic))
        {
        echo 
"file <b>$imageName</b> successfully written";
        }
        else
        {
                    echo 
"file <b>$imageName</b> was NOT written";
        }
        }
    
fclose ($fileHandle);
    
fclose ($thePic);
    }
    else
    {
        
// The file was not created.  Inform the user.
        
echo "<b> The file: $imageUpFile could not be created!</b>";
    } 

Reply With Quote
  #2  
Old July 13th, 2002, 02:01 AM
shankar_79 shankar_79 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: INDIA
Posts: 17 shankar_79 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
use instead the ftp functions.

Reply With Quote
  #3  
Old July 13th, 2002, 02:56 PM
liljim's Avatar
liljim liljim is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: England
Posts: 954 liljim User rank is Lance Corporal (50 - 100 Reputation Level)liljim User rank is Lance Corporal (50 - 100 Reputation Level)liljim User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 18 h 30 m 49 sec
Reputation Power: 8
Is there anything wrong with you using the copy() or move_uploaded_file() functions? It makes more sense to me to use this in your instance.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > 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 2 hosted by Hostway
Stay green...Green IT