Shop OBEX P1 Docs P2 Docs Learn Events
File Attachment problem with spaces in filename - Some browsers have issues... — Parallax Forums

File Attachment problem with spaces in filename - Some browsers have issues...

RobotWorkshopRobotWorkshop Posts: 2,307
edited 2007-09-26 18:22 in General Discussion
Hello,

I've had issues with Firefox downloading attachments. In all cases it seems to be that there are spaces in the filename which cause the problem. It dumps the rest of the filename after the first space and as a result loses the extension for the file type. It may be that the forum isn't converting the space in the filename before sending it out to the browser.

A better solution may to avoid using spaces in filenames which prevents the issue in the first place.

If you have problems with attachments try a different browser as they all seem to act a little differently.

Robert

Comments

  • slashsplatslashsplat Posts: 63
    edited 2007-09-25 21:33
    We use FF and have not seen that issue, but have not downloaded from this forum.
    When the url is sent to the browser with the name embedded, it must be "escaped" properly. If the download code is not doing that, the browser cannot differentiate a space in a file name from a space intended to delimit parms.

    Could you point me to a file here with that and I can possibly ID the issue?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2007-09-26 15:27
    Hello,

    I do believe that the issue is that the name isn't being escaped properly and that is why I brought it up. It only occurs when there are spaces in the filename. I've seen attachments like this in both the SX forum and the Propeller Forum. One post in particular has one attachment that works (uses and underline) and one that doesn't (with spaces in the name):

    http://forums.parallax.com/forums/default.aspx?f=7&m=212243

    It's been like that for a while and may be causing other people problems as well.

    Hopefully it would be a quick fix to the forum code.

    Robert
  • Harrison.Harrison. Posts: 484
    edited 2007-09-26 18:22
    It's definitely a problem with the way the forum sends out the filename in the http headers. The filename should have quotes around it, but it doesn't. It should be a simple fix as long as Parallax has the source to the forums.

    HTTP/1.1·200·OK(CR)(LF)
    Connection:·close(CR)(LF)
    Date:·Wed,·26·Sep·2007·18:19:12·GMT(CR)(LF)
    Server:·Microsoft-IIS/6.0(CR)(LF)
    X-Powered-By:·ASP.NET(CR)(LF)
    X-AspNet-Version:·1.1.4322(CR)(LF)
    Content-Disposition:·inline;·filename=Test·SX·module·SPI.bs2(CR)(LF)
    Cache-Control:·public,·max-age=30(CR)(LF)
    Expires:·Wed,·26·Sep·2007·18:19:42·GMT(CR)(LF)
    Last-Modified:·Wed,·26·Sep·2007·18:19:12·GMT(CR)(LF)
    Vary:·*(CR)(LF)
    Content-Type:·application/octet-stream(CR)(LF)
    Content-Length:·770(CR)(LF)
    (CR)(LF)
    



    The funny thing is, one of my .net web apps also has this problem, which can easily be fixed with (obviously vb.net):
    HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename=""{0}""", strFileName))

    Post Edited (Harrison.) : 9/26/2007 6:28:24 PM GMT
Sign In or Register to comment.