SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)

    cURL download constantly fails

    So I have a script which runs out and downloads pdfs from a local web server. Script works great, detects if the cURL fails and notifies you. I have some files that will constantly fail, reading 1kb on disk, but the cURL doesn't come back with an error.

    I find it a little curious that it's not intermittently failing on different files, but always the same files. On all files that fail, I can use the same link that the script is using and open the PDF in the web browser without any problem. These are not https:// addresses either, I had already addressed an issue with that before...

    Any pointers on things to check / ideas what might be going on

    EDIT: The error checking I have in place grabs file size before cURl and after from local source, if difference != 0 then it throws an error. It is capturing my problem files just fine. I cannot find a reason or any notification that these are failing other than my file size check.

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    Have the file size check report the file sizes it's getting in that check, might give you a hint as to which side is going wrong (local filesize = 0, or remote filesize = 0?). (bad filenames for local storage? File already exists but is unwritable?)
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by StarLion View Post
    Have the file size check report the file sizes it's getting in that check, might give you a hint as to which side is going wrong (local filesize = 0, or remote filesize = 0?). (bad filenames for local storage? File already exists but is unwritable?)
    It's always the local file that is smaller / corrupt (near 1kb). Also, each time the script is run it makes a new folder based on datetime hash, so the file doesn't exist already.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •