in reply to Verify file is there in a remote server

What kind of server?

One would presume that whatever protocol you used to upload the file has a function to retrieve information about the file too. Then again, I shouldn't make assumptions about a protocol that doesn't even let you if a transfer was successful or not.

  • Comment on Re: Verify file is there in a remote server

Replies are listed 'Best First'.
Re^2: Verify file is there in a remote server
by Anonymous Monk on Apr 01, 2010 at 01:57 UTC
    I am using a custom made file protcol to upload files, but I can use http to retrieve the file info.

      The easiest and simplest way, since you only have http access to those files.

      Write a script and put it there with the files, then you can call that script with file name as a param e.g: getsize.pl?file=somefile.zip.

      It will then return the filesize or checksum or both (it's up to you to decide). And you can use LWP to fetch the response automatically

      If the file is web accessible, you could probably do a HEAD request to fetch its size. Or better yet, return the information you want in the response to your upload request.