On the fly local file encoding and upload...

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

    #1

    On the fly local file encoding and upload...

    Hi all,

    I'm just wondering if it is possible to upload a local file (using a
    <input file> but instead of just sending it, applying a treatment
    (encoding) to the file while sending it.

    Typically, I would like the file the browser sends to be uuencoded
    (sent as text), so that the Web server can treat it as any other text
    field.

    So for example, the user opens a HTML page with a <form ...> <input
    file> section inside; selects a local file; clicks "submit" and the
    file is - through Javascript ! - uuencoded and POSTed towards the
    server.

    It does not matter at all if this only works only with IE ;)

    I know Javascript a bit but wouldn't be able to code this, at the
    moment, I just need to know if it is really possible.

    Thanks !

  • Grant Wagner

    #2
    Re: On the fly local file encoding and upload...

    "Savane78" <savanedebrossa rd@yahoo.fr> wrote in message
    news:1115990033 .187549.271240@ o13g2000cwo.goo glegroups.com.. .[color=blue]
    > Hi all,
    >
    > I'm just wondering if it is possible to upload a local file (using a
    > <input file> but instead of just sending it, applying a treatment
    > (encoding) to the file while sending it.
    >
    > Typically, I would like the file the browser sends to be uuencoded
    > (sent as text), so that the Web server can treat it as any other text
    > field.[/color]

    The contents of the file specified by an <input type="file" ...> are
    sent (or should be) as enctype="multip art/form-data" during the POST.
    You have no control over this.

    Simply have your server-side processing save the file to a temporary
    location, open it and read it as text, process that text, then discard
    the file.

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq


    Comment

    • Savane78

      #3
      Re: On the fly local file encoding and upload...

      > The contents of the file specified by an <input type="file" ...> are[color=blue]
      > sent (or should be) as enctype="multip art/form-data" during the POST.[/color]
      [color=blue]
      > You have no control over this.
      >
      > Simply have your server-side processing save the file to a temporary
      > location, open it and read it as text, process that text, then[/color]
      discard[color=blue]
      > the file.
      >
      > --
      > Grant Wagner <gwagner@agrico reunited.com>
      > comp.lang.javas cript FAQ - http://jibbering.com/faq[/color]

      The context is a bit particular as I don't have control on server side
      processing.

      But thanks for answering : now I know I can't proceed this way.

      --
      Savane

      Comment

      Working...