TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-08-2009, 07:47 AM   #1 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 16
Thanks: 2
ChrisR is on a distinguished road
Default ftp_fget error help.

I am getting this error here is the lines of code for it.

Quote:
Warning: fopen(data.zip) [function.fopen]: failed to open stream: Permission denied in /home/admin/*****/*****/update.php on line 75

Warning: ftp_fget() expects parameter 2 to be resource, boolean given in /home/admin/*****/*****/update.php on line 84
There was a problem while downloading sw_0.11.zip to data.zip
Warning: fclose(): supplied argument is not a valid stream resource in /home/admin/*****/*****/update.php on line 92
line 75 starts at $handle.
PHP Code:
 $remote_file "sw_{$version}.zip";
 
$local_file "data.zip";
 
 
$ftp_server "***.**.***.***";
 
$ftp_user_name "**************";
 
$ftp_user_pass "***************";
 
// open some file to write to
$handle fopen($local_file'w');

// set up basic connection
$conn_id ftp_connect($ftp_server);

// login with username and password
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

// try to download $remote_file and save it to $handle
if (ftp_fget($conn_id$handle$remote_fileFTP_ASCII0)) {
 echo 
"successfully written to $local_file\n";
} else {
 echo 
"There was a problem while downloading $remote_file to $local_file\n";
}

// close the connection and the file handler
ftp_close($conn_id);
fclose($handle); 
ChrisR is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 03:55 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design