User file uploads

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pjotr Wedersteers

    User file uploads

    Hi,

    I am building a page that allows people to send in text and/or html files
    and have them analyzed for several statistics by a serverside PHP script.

    I'd like the files to be sent zipped or rar'd or whatever flavour is
    opensource, free and available. How can I -other than by asking them to zip
    their files- ensure the files they send are compressed before they're
    actually sent ? I guess this must be done in JS ? Can the PHP script
    auto-decompress the files and process the contents ?
    And when I send their analysis back as HTML, is it possible to have that
    sent in a zipped way and auto-decompressed in the viewer's browser ? I don't
    really understand the Apache zip option in the configuration.

    Help much appreciated.
    Pjotr


  • Richard Cornford

    #2
    Re: User file uploads

    Pjotr Wedersteers wrote:[color=blue]
    > I am building a page that allows people to send in text and/or html
    > files and have them analyzed for several statistics by a serverside
    > PHP script.
    >
    > I'd like the files to be sent zipped or rar'd or whatever flavour is
    > opensource, free and available. How can I -other than by asking them
    > to zip their files- ensure the files they send are compressed before
    > they're actually sent ?[/color]

    You absolutely cannot do that.
    [color=blue]
    > I guess this must be done in JS ?[/color]

    Unlikely as javascript has no file manipulation features built in.
    Javascript is also not capable of 'ensuring' anything as client-side
    scripting may be disabled/unavailable, subverted or by-passed. Anything
    arriving at a server in an HTTP request should be regarded as unknown
    and suspect.
    [color=blue]
    > Can the PHP
    > script auto-decompress the files and process the contents ?[/color]

    A question better asked in a PHP group, but the answer is probably yes.
    [color=blue]
    > And when I send their analysis back as HTML, is it possible to have
    > that sent in a zipped way and auto-decompressed in the viewer's
    > browser ?[/color]

    Doesn't HTTP 1.1 include provision for doing exactly that automatically?
    [color=blue]
    > I don't really understand the Apache zip option in the
    > configuration.[/color]

    RTFM, then ask an apache/http server group.

    Richard.


    Comment

    Working...