Sponsored Content
Top Forums Shell Programming and Scripting How to check if downloading of a file is completed? Post 302989107 by looney on Sunday 8th of January 2017 04:30:53 AM
Old 01-08-2017
Quote:
Originally Posted by Don Cragun
Let us propose that your 3rd party send you a zip file named file.zip (as they are doing now) and after they have sent you file.zip they then send you a file named file.checksum containing the checksum for file.zip. I am suggesting that instead of trying to figure out when file.zip is complete by trying to determine when it has stopped growing, you instead just watch for non-zero length files with names ending in .checksum. For each non-zero length file.checksum you find you will know that you have a complete corresponding file.zip and you can verify that it was received correctly by comparing the contents of file.checksum to the checksum of the file file.zip.
Thanks Mr Don, this seems very valid approach to wait for completion of transfer of main file by watching it's checksum file that will arrive at end. But just for a knowledge how third party will handle this. Presently they are manually uploading file to our end, So they can also send the checksum file for now but how this can be automated. How code can recognise if the uploading is completed and checksum file can be transferred.
Thanks.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Downloading Excel File

Hello All, Currently working with CGI scripts in perl which involves a) uploading b) processing c) downloading the file back to the user uploading and processing quite trivial and they are done Third part is kind of being tricky. Excel file in binary format is getting displayed in the... (4 Replies)
Discussion started by: matrixmadhan
4 Replies

2. Shell Programming and Scripting

Downloading a csv file automatically

I want to automatically download a CSV file daily which can be found here: London Stock Exchange - Search and the link is named "Click to download covered warrants (100Kb)" on the right hand side. What commands can I use to invoke clicking on this link and initiating the download? And also... (2 Replies)
Discussion started by: figaro
2 Replies

3. Shell Programming and Scripting

Downloading file from internet

Hi, I need to write a script to download a file (say http: //www.mysite.com/myfile.txt) from the internet (please note that the file is on http not ftp). Please let me know if there is any method other than wget. Thanks, Chetan (4 Replies)
Discussion started by: chetanpc
4 Replies

4. Shell Programming and Scripting

File downloading

Hi, I am newbie in Perl/CGI and I need your help to develop a little script to help me to download some files located in a FTP server via HTTP to a disk. I need to authenticate with username/password via a HTTP page and I can choose the files to download from the web page to my disk. Can... (2 Replies)
Discussion started by: imad77
2 Replies

5. UNIX for Dummies Questions & Answers

Unix command used for downloading file from net

Hi, Which command I can use to download a file from website? I tried with wget and lwp-dowload but no gain. Can any one suggest me the good way to dowload? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

6. Shell Programming and Scripting

File downloading help in perl

Im trying to write a perl code to do the following task. I have a website which is located in a diffirent country. I want to download a file from that site everyday. The file name keeps on changing everyday. say the file name is CTP-latest-5.3.0.37.iso next day it may change to... (0 Replies)
Discussion started by: srijith
0 Replies

7. UNIX for Dummies Questions & Answers

Need help in not fetching a file while file writing operation is not completed

Hi All, We have a Unix program in oracle when we run the program this connects to specified ftp and will get the file into local server. We are facing a problem like when file writing operations is not completed, this program is getting the incomplete file. Could anyone please help me... (2 Replies)
Discussion started by: world.apps
2 Replies

8. Shell Programming and Scripting

Downloading file from mainframe to UNIX

Hi All , I need a help regarding file ftp ing from mainframe to unix.Our source file is mainframe file.I need to download the mainframe file to local unix server through unix script.If anyone can help me how we can do it through unix script ,it will be really helpful.Thanks. (7 Replies)
Discussion started by: STCET22
7 Replies

9. UNIX for Beginners Questions & Answers

File downloading

I saved to disk using lynx, under ls it shows up but no matter what I have done back comes the statment no such file. How do you erase these ls false readings or open what ls shows? (9 Replies)
Discussion started by: Jackbird
9 Replies
FTP_GET(3)								 1								FTP_GET(3)

ftp_get - Downloads a file from the FTP server

SYNOPSIS
bool ftp_get (resource $ftp_stream, string $local_file, string $remote_file, int $mode, [int $resumepos]) DESCRIPTION
ftp_get(3) retrieves a remote file from the FTP server, and saves it into a local file. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $local_file - The local file path (will be overwritten if the file already exists). o $remote_file - The remote file path. o $mode - The transfer mode. Must be either FTP_ASCII or FTP_BINARY. o $resumepos - The position in the remote file to start downloading from. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ftp_get(3) example <?php // define some variables $local_file = 'local.zip'; $server_file = 'server.zip'; // 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 $server_file and save to $local_file if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file "; } else { echo "There was a problem "; } // close the connection ftp_close($conn_id); ?> SEE ALSO
ftp_pasv(3), ftp_fget(3), ftp_nb_get(3), ftp_nb_fget(3). PHP Documentation Group FTP_GET(3)
All times are GMT -4. The time now is 04:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy