473,657 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ftp_get() on new domain won't download files

unicorn
23 New Member
Hi guys,

I have moved my site from one domain to another. it worked perfectly on old domain, ftp_put(), ftp_delete() - i.e. FTP upload and remove scripts work fine, but... i have problem using ftp_get() wicth shows me error, and says :

Warning: ftp_get() [function.ftp-get]: Error opening 4.gif in /home/mydomain/public_html/down_att.php on line 43

Couldn't download file '4.gif' .


i have checked connection, path. well if i change path (ftp directory) to this file it gives me error that it cannot find this file on this path, so path is correct.

i have checked directories, filename, permissions. i have no clue why it doesn work, i appriciate your advice, thanks.
Jul 18 '07 #1
13 4404
pbmods
5,821 Recognized Expert Expert
Heya, unicorn.

i have checked connection, path. well if i change path (ftp directory) to this file it gives me error that it cannot find this file on this path, so path is correct.
I'm confused. If you tried the path, and it said that it couldn't find the file, doesn't that mean that the path is *not* correct?
Jul 18 '07 #2
pbmods
5,821 Recognized Expert Expert
Changed thread title to better describe the problem.
Jul 18 '07 #3
unicorn
23 New Member
read more carefully, i said 'when' i changed path from 'correct' path to 'incorrect' path, it showed me error that file is not found, that means that when path was correct, it could see file, but couldn't read it. thanks...
Jul 18 '07 #4
pbmods
5,821 Recognized Expert Expert
Ok, so what you're saying is if you were to drop into your command line, fire up ftp and attempt to GET the image at the path that you are currently using, ftp will download the file without a hitch.

But when you try more or less the same thing in PHP, you get the error.

Is this correct?
Jul 18 '07 #5
unicorn
23 New Member
Ok, so what you're saying is if you were to drop into your command line, fire up ftp and attempt to GET the image at the path that you are currently using, ftp will download the file without a hitch.

But when you try more or less the same thing in PHP, you get the error.

Is this correct?
yes exactly, if i access file (image or whatever) through command line or ftp manager, there is no problem, i can write, delete, do whatever i want to this files in that directory but cannot download. i wrote hosters, but thay said that maybe my ip addres is blocked :) i've never heard anything more silly... if it is blocked how can i WRITE or DELETE files through PHP commands... oh, and this files are not in common directlry (public_html), because i want to prevent direct access...

first i thought that maybe there are some problems with permissions on /tmp directory (probably place where it copies file till it sends file) but i've sett all permissions to 0777...

thank you for your soon reply :)
Jul 18 '07 #6
pbmods
5,821 Recognized Expert Expert
Oh. Then I have no idea.

Haha Just kidding!

Ok. So there's some kind of error when you attempt to ftp_get() the file.

Couple of ideas rattling around in my head right now:
  • Is the problem specifically related to ftp_get()? In other words, can you include() or file_get_conten ts()?
  • Can you read a file in the same directory? What if you moved the file to a different directory?
  • Are there any symbolic links in the path (ok, so now I'm grasping at straws)?

Also, is ftp_get() giving you the 'Error opening 4.gif' warning, or is that a custom trigger_error() ? What does your error_log say?
Jul 18 '07 #7
unicorn
23 New Member
Oh. Then I have no idea.

Haha Just kidding!

Ok. So there's some kind of error when you attempt to ftp_get() the file.

Couple of ideas rattling around in my head right now:
  • Is the problem specifically related to ftp_get()? In other words, can you include() or file_get_conten ts()?
  • Can you read a file in the same directory? What if you moved the file to a different directory?
  • Are there any symbolic links in the path (ok, so now I'm grasping at straws)?

Also, is ftp_get() giving you the 'Error opening 4.gif' warning, or is that a custom trigger_error() ? What does your error_log say?
ok, here we go:

i have tryed to GET other files in other directories (including php script folder and root folder), it gives same error. in error log it says:

ftp_get() [<a href='function. ftp-get'>function.f tp-get</a>]: Error opening 4.gif in /home/ mydomain/public_html/down_att.php on line 43

in download script i'm using include() to include script with functions and to include configuration file. and i doesnt give me any error and functions work (i have checked in output stream).

and there are not symbolic characters in path, (i have tryed root folder...) only alphabet & numeric.

thank you again.
Jul 19 '07 #8
pbmods
5,821 Recognized Expert Expert
Heya, Unicorn.

I've posted a note on our PHP Expert panel. Hopefully we can get some more brains pondering over this problem.
Jul 19 '07 #9
unicorn
23 New Member
Heya, Unicorn.

I've posted a note on our PHP Expert panel. Hopefully we can get some more brains pondering over this problem.
thanks a lot. i hope i will receive normal answer from hoster too :)
Jul 19 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1958
by: John | last post by:
Are there any precautions that I should take when downloading a file from a remote file on Linux platform to a local file in Win98 platform? I am using the method ftp_get $remotefile = '../products.txt'; $localfile = 'C:/data/products.txt'; ftp_get($conn, $localfile, $remotefile, FTP_ASCII)) Thank you John
27
3252
by: Tim Tyler | last post by:
Are there many PHP public domain projects out there? I'm particularly interested in CMS project materials. So far - outside of my own projects - I've found /very/ little PD PHP material out there. A large proportion of the PHP community seems to have embraced the Gnu licenses - complete with all their restrictions on the users of the software.
0
1677
by: rstuckart | last post by:
A script successfully connects to a remote server, logs in, reports the size of a file on the server. The problem is that it will not download the file with either ftp_get or ftp_fget. The Configure Command shows: --enable-safe-mode, but safe_mode is OFF, safe_mode_exec_dir has no value, safe_mode_gid is ON, safe_mode_include_dir and open_basedir each have no value. Function set_time_limit() runs without complaint, so I am fairly...
1
1969
by: ralphNOSPAM | last post by:
I'm trying to download a text file named KLAX.TXT at tgftp.nws.noaa.gov using if (ftp_get($conn_id, "Metar Reports/$local_file", $server_file, FTP_BINARY)) { print "Success";
5
5521
by: Alex | last post by:
I'm trying to make simple ftp client, used the following article for base: http://www.devarticles.com/c/a/PHP/Building-An-FTP-Client-With-PHP/3/ All works, I can login, see list of files, but except ftp_put and ftp_get functions. They return always false. I tried to set passive mode, it doesn't help. Any advice will be appreciated.
2
1706
by: cxian | last post by:
Hi all, I am trying to download files from a remote with the use of ftp_get. Somehow, the script always return to false. Here's what I got: $conn_id = ftp_connect($ftp_host); $login_result = ftp_login($conn_id, $ftp_username, $ftp_password);
1
1771
by: irfan.mohammed | last post by:
Dear All, I need your help,i am using ftp_get for getting the file from remote machine.now i am able to save only at one location.i want the user to select the directory any where in the computer and able to save it. Thanks in advance Irfan
2
4979
by: empiresolutions | last post by:
I am using ftp_get to transfer a file from a secure location, to a temp location. (working) Once at the temp location i need to have the file automatically download to the clients local machine. Something like a right click "save as" action. How do i do this? I'm thinking its done with headers but not sure. My Current Code is below. Thanks for all responses. // define some variables $ftp_server = "123.45.67.890"; $local_file =...
1
1645
by: marcarlem | last post by:
Sorry about my english but it´s not my first lenaguage. i got a problem using ftp_get. My FTP server is working properly (I can upload and download files to it) but when I try to download a File using PHP code doesn´t seems work. The file is saved in the ServerSide instead clientSide. this is a portion of my code. $Local and $Remoto has the same name of file, without path, but don´t work wether add a path or not to $Local I would appreciate...
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.