Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 12 of 12

This is a discussion on Corrupt Files in the Shared & Semi-Dedicated forum
Is there anything that might exist in a php script that would commonly cause file downloads to become corrupt? I've got a file that works ...

  1. #1
    JPC Addict
    Join Date
    May 2003
    Location
    Canada
    Posts
    141

    Corrupt Files

    Is there anything that might exist in a php script that would commonly cause file downloads to become corrupt? I've got a file that works fine on my HD, but when I upload it to my forum and try to download again it becomes 0-1kb and corrupted. I've tested the download in both IE and Firefox.
    Memento Mori

  2. #2
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Make sure you're uploading and downloading in the proper file format, i.e. text or binary. Soemtimes the automatic detection process can mess up your file(s).

  3. #3
    JPC Addict
    Join Date
    May 2003
    Location
    Canada
    Posts
    141
    I assume the script has this setup correctly, as it has always worked fine on my old host.
    Memento Mori

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I think the file is getting bonked when you upload it to your server, not when you download it, although HTTP downloads are notoriously flakey. What method are you using to upload it? FTP, SCP, et cetera?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    I was assuming that he was saying his php server-side script is doing the upload, but I might be mistaken. It happens.

  6. #6
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    There are a number of things that could be happening here. First, if you are uploading it via HTTP then it could be getting corrupted in transit. When you upload through a web site, it is up to the browser and server to figure out what type of file it is as well as wheter it should be transferred in ASCII or binary mode. Be sure that the file has a commonly used extension (such as .jpg, .txt, .pdf, etc.), since that's what's generally used to figure how a file should be handled.

    It could also be that the file is being downloaded improperly. Again, this could be due to the server sending the wrong file type to the browser. For example, if you are sending an image file, but the server thinks it is text, it is going to be converted into the text format of the receiving system and will become corrupted in the process. For this you need to be sure that the file's extension is associated with the corect MIME type (in CPanel). However, if a script is handling the download, the script needs to know what MIME type to send, and this might be a little trickier to solve.

    It is also possible that something in PHP is altering the file, although I find this very unlikely. However, this could happen if, say, the file is an image (or PHP thinks it is) and the script opens it to add a watermark or resize it.

    Since it worked fine on your other server and I am assuming that you aren't doing anything different from your end, I'd assume it is a browser-server problem and not a PHP problem.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  7. #7
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,648
    Nothing to do with this thread Maybe. Every file I have downloaded for stats for several months have been corrupted. In fact I downloaded some graphics the other day, they were corrupt. I can live without the raw logs for now, but I think Jag perhaps has some problems in regard to uploads and downloads that others are not experiencing.

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

  8. #8
    A geezer, with 1 foot in. Oldfrog's Avatar
    Join Date
    Apr 2004
    Posts
    204
    I haven't been seeing that, Connie. I am moving things back and forth frequently using FTP and at least one other person downloads regularly. If there has been any evidence of corruption we haven't seen any.
    Gravity, more than a good idea, it's the law!

  9. #9
    JPC Addict
    Join Date
    May 2003
    Location
    Canada
    Posts
    141
    Quote Originally Posted by Ron
    I was assuming that he was saying his php server-side script is doing the upload, but I might be mistaken. It happens.
    Yes, she was saying that the php script is doing the uploading.
    Memento Mori

  10. #10
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Pardonnez mon erreur, Madame.
    (Les bourgeois, c'est comme les cochons.
    Plus ça devient vieux, plus ça devient bête.
    Plus ça devient bête, plus ça devient con.)
    Last edited by Ron; 02-21-2005 at 10:48 PM. Reason: spelling, spelling spelling

  11. #11
    JPC Addict
    Join Date
    May 2003
    Location
    Canada
    Posts
    141
    Happens all the time... for some reason?!
    Memento Mori

  12. #12
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Heh. I just ran that through babelfish...:
    Quote Originally Posted by babelfish.altavista.com
    Forgive my error, Madam. (the middle-class men, it is like the pigs. The older that becomes, the more that becomes stupid. The stupider that becomes, the more that becomes idiot.)
    "Stupider?"
    Quote Originally Posted by systranbox.com
    Forgive my error, Madam. (the middle-class men, it is like the pigs.
    The older that becomes, the more that becomes stupid. The stupider
    that becomes, the more that becomes idiot.)
    Identical grammatical error. Hmmmmm.
    Quote Originally Posted by worldlingo.com
    Forgive my error, Madam.
    (middle-class men, it is like the pigs.
    More that becomes old, more that becomes stupid.
    More that becomes stupid, more that becomes idiot.)
    Quote Originally Posted by translation.paralink.com
    Excuse my mistake, Madam.
    (The middle-class persons, it is as pigs.
    The more this becomes old, the more this becomes stupid.
    The more this becomes stupid, the more this becomes bloody stupid.)
    Not one of them picked up on their disagreement between verb and noun "LES Bourgeois" is a collective noun, they turned it into a plural noun. They would have been better advised to translate it into "the middle class" instead of "middle class men|persons".

    I tried it capitalilzed, too. The results were funny; they all capitalized Middle.

    Loses something in the translation, I guess.

    But then, what do I know about translation? I don't even speak French.

    [EDIT: I just checked two online sources: Merriam-Webster through m-w.com, and American Heritage through dictionary.com... both had entries for "stupider". What does that make me compared to the translator? Stupider! lol ]

    Discussion on "stupider" at the Institute of Linguists:
    http://www.iol.org.uk/discussion/viewtopic.asp?id=1019
    Note my "stupidest" comment at the bottom

    I guess I'm bored today.
    Last edited by Ron; 02-22-2005 at 04:42 PM. Reason: Many "typoes". My typoing is getting more better all the time.

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
  •