Attachments download an attachment.php file instead of the attachment itself

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Attachments download an attachment.php file instead of the attachment itself Future is online now
    SupervisorRank
    Dec 2011 Join Date
    1,837Posts

    Attachments download an attachment.php file instead of the attachment itself


    RaGEZONE Recommends

    RaGEZONE Recommends

    I'm basically having the same issue as pokchop had right now: File Attachments

    When I try downloading the attachment from this thread: [help]a lot of errors
    I end up downloading several attachment.php files instead of the attachment itself:



    I'm using Google Chrome 48.0.2564.116 with Windows 10 at the moment

    I've had this in the past and it was solved temporarily I think but I don't remember how (if it was something I needed to do).

    I also did a search for it here in the bug reports but I could only find pokchop1's thread which is unanswered and I didn't wanna bump a 2 yo thread, so I'm sorry if this has an answer already somewhere :s

    Edit: I just found out that the file is being downloaded correctly, just the extension is wrong. When renaming the file to .rar instead of .php it actually works. Maybe this is just a naming problem?
    Last edited by Future; 07-03-16 at 10:38 AM. Reason: found out that it downloads correctly but with wrong extension




    Quote Originally Posted by A Wise Man
    P-Servers are NOT dead. Bugs need squishing. Quests need fixing. Unfortunately, majority of people don't know the difference between a computer and a toaster so...


  2. #2
    Gold subscription Kimberly is online now
    Gold SubscriberRank
    Jul 2012 Join Date
    The NetherlandsLocation
    637Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Works fine for me as Version 48.0.2564.116 m (64-bit) of Google Chrome.

    Here's a mirror of the file you tried to download in case you need it urgent: https://drive.google.com/file/d/0B8g...J2NkFlVGM/view

    EDIT: See your edit, nervermind. Anyway, its working fine me; it downloads it as a .rar and only 1 file.

  3. #3
    Attachments download an attachment.php file instead of the attachment itself Future is online now
    SupervisorRank
    Dec 2011 Join Date
    1,837Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Thanks for the feedback. Yes it downloads only 1 time for me as well, I just gave it several tries.
    It's really strange that it works as .rar for you on the same version of Google Chrome. What's your operating system?
    I just tried "saving the link as" by right clicking it, but that does the same thing for me.




    Quote Originally Posted by A Wise Man
    P-Servers are NOT dead. Bugs need squishing. Quests need fixing. Unfortunately, majority of people don't know the difference between a computer and a toaster so...

  4. #4
    Gold subscription Kimberly is online now
    Gold SubscriberRank
    Jul 2012 Join Date
    The NetherlandsLocation
    637Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    I just tried it again and now it downloads as attachment.php. I am clueless since clearly it worked earlier, seeing I've even made a mirror of it.

    Windows 10 OS btw.

  5. #5
    GET OVER HERE! MentaL is offline
      Administrator  Rank
    Dec 2000 Join Date
    32,919Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    highly odd, unsure whats causing it .
    RaGEZONE Recommends

  6. #6
    "(still lacks brains)" NoBrain is online now
    ModeratorRank
    Sep 2011 Join Date
    United KingdomLocation
    2,686Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Attachments seem to be working fine for me, could be certain accounts.

  7. #7
    Deep thoughts Attachments download an attachment.php file instead of the attachment itself Joopie is online now
    SubscriberRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,584Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Last edited by Joopie; 07-03-16 at 01:05 PM.

  8. #8
    Ultimate Member Calas is online now
    MemberRank
    Aug 2011 Join Date
    Sousse, TunisiaLocation
    176Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    If you change the extension name from .php to .rar you'll be able to open the file ijs

    Edit : btw issue still occurs

  9. #9
    Attachments download an attachment.php file instead of the attachment itself Future is online now
    SupervisorRank
    Dec 2011 Join Date
    1,837Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Quote Originally Posted by Future View Post
    I just found out that the file is being downloaded correctly, just the extension is wrong. When renaming the file to .rar instead of .php it actually works. Maybe this is just a naming problem?
    I added that info already. Also didn't download attachments till now so I can't say whether it still occurs




    Quote Originally Posted by A Wise Man
    P-Servers are NOT dead. Bugs need squishing. Quests need fixing. Unfortunately, majority of people don't know the difference between a computer and a toaster so...

  10. #10
    Ultimate Member Calas is online now
    MemberRank
    Aug 2011 Join Date
    Sousse, TunisiaLocation
    176Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Quote Originally Posted by Future View Post
    I added that info already. Also didn't download attachments till now so I can't say whether it still occurs
    Still occurs if you try to download the attachment that you once downloaded before like @Kimberly stated

  11. #11
    Newbie vnhello is offline
    MemberRank
    Jun 2016 Join Date
    1Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Hello, i can't download attachment (JoinServer MD5) at link. Somebody help me?

    How to Add MD5 to Database!

  12. #12
    GET OVER HERE! MentaL is offline
      Administrator  Rank
    Dec 2000 Join Date
    32,919Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    no file = deleted via the server due to detected malware.
    RaGEZONE Recommends

  13. #13
    Gaby is offline
      V.I.P  Rank
    Apr 2013 Join Date
    The NetherlandsLocation
    1,470Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    I downloaded it with ghostery browser on my phone and it picked up .rar as the extension. Maybe it is really a chrome problem.

    - - - Updated - - -

    Tried it for a second time, it picks .rar as the extension again.

    - - - Updated - - -

    This will only be of benefit when you're dealing with an HTML file or an image. If you navigate to a rar file, the browser will download it automatically.

    - - - Updated - - -

    You need to set the correct Content-Type (MIME type of the file) and Content-Disposition (attachment + filename ending with the extension) headers of the download with PHP.


  14. #14
    Deep thoughts Attachments download an attachment.php file instead of the attachment itself Joopie is online now
    SubscriberRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,584Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    Quote Originally Posted by Gaby View Post
    I downloaded it with ghostery browser on my phone and it picked up .rar as the extension. Maybe it is really a chrome problem.
    It's the same for IE/FF, so that's not the case.

    Try download the file and refresh the page and download it again.


    This will only be of benefit when you're dealing with an HTML file or an image. If you navigate to a rar file, the browser will download it automatically.
    The download attribute tells the browser to download the link, the value you give is the name of the file so you can override the links filename.
    Normally the browser will indeed download a rar file, but because you navigate to a php file it won't.

    You need to set the correct Content-Type (MIME type of the file) and Content-Disposition (attachment + filename ending with the extension) headers of the download with PHP.
    That would also be a legit solution.

  15. #15
    Gaby is offline
      V.I.P  Rank
    Apr 2013 Join Date
    The NetherlandsLocation
    1,470Posts

    Re: Attachments download an attachment.php file instead of the attachment itself

    These are the current download headers:



    It makes use of the Content-Type application/rar, which doesn't exist. For rar files the Content-Type should be application/x-rar-compressed

    It's also missing the Content-Disposition header, which sends the filename to the browser and tells the browser it's a downloadable file, for the attachment that @Future had the problem with, the Content-Disposition header should be:
    attachment; filename="logs.rar"

    - - - Updated - - -

    Quote Originally Posted by Joopie View Post
    The download attribute tells the browser to download the link, the value you give is the name of the file so you can override the links filename.
    Normally the browser will indeed download a rar file, but because you navigate to a php file it won't.
    True! ^^ I doubt it will work with only the download attribute though, since the browser is still sending the headers of a PHP file.





Page 1 of 2 12 LastLast

Advertisement