473,320 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Downloading files with ftp_get

Hi guys! I have a problem with php function ftp_fget:
I try to get file from ftp server and save it to disk, but when i look at downloaded file it is first symbol missing there... what can it be?
code:
Expand|Select|Wrap|Line Numbers
  1. ftp_fget($conn_id, $handle, $path."/".$remote_file, FTP_BINARY, 1) 
nothing special, all variables exist the problem only in first symbol :)
Dec 20 '05 #1
2 3179
Niheel
2,460 Expert Mod 2GB
Try it without the 1 at the end.

Expand|Select|Wrap|Line Numbers
  1. ftp_fget($conn_id, $handle, $path."/".$remote_file, FTP_BINARY) 
Other than that your code looks normal. Your file is a binary file right? (archive, image, media file?).

Also check the file before you download it. Is it already corrupt?
Dec 20 '05 #2
It works! Thanks a lot!
Dec 21 '05 #3

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

Similar topics

7
by: Xerxes | last post by:
Hi, I have a link in my page that allows users to download an exe file. However, when I download and run it, it briefly displays the DOS box and nothing happens. In my php file, I have: ...
0
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...
1
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";
3
by: paddy_nyr | last post by:
I have an FTP process where my files are download to dirve x:\ftpdownloads I then want to move those files from x:\ftpdownloads to c:\temp. I've tried the copy function without any luck. Thanks
1
by: Vic Spainhower | last post by:
Hello, I am trying to download a file to my local machine using PHP. However, when the script runs the file is placed in the folder assigned to the ftp user on the Web server instead of...
2
by: Paul | last post by:
I need to copy files from an ftp directory to a web-accessible directory and then delete the files in the ftp directory. (I am doing it this way because web-based form upload can not exceed 2MB...
1
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...
13
unicorn
by: unicorn | last post by:
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...
2
by: blindlemonsam | last post by:
PHP version 4.4.4 Hi, what I'm trying to do is download though php (using ftp functions) a file from a home server in chunks (to prevent a browser from timing out). The files go from...
2
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....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.