in reply to Re: Verify file is there in a remote server
in thread Verify file is there in a remote server

I am using a custom made file protcol to upload files, but I can use http to retrieve the file info.
  • Comment on Re^2: Verify file is there in a remote server

Replies are listed 'Best First'.
Re^3: Verify file is there in a remote server
by ahmad (Hermit) on Apr 01, 2010 at 02:26 UTC

    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

Re^3: Verify file is there in a remote server
by ikegami (Patriarch) on Apr 01, 2010 at 02:43 UTC

    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.