On the fly local file encoding and upload...

S

Savane78

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 !
 
G

Grant Wagner

Savane78 said:
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.

The contents of the file specified by an <input type="file" ...> are
sent (or should be) as enctype="multipart/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.
 
S

Savane78

The contents of the file specified by an said:
sent (or should be) as enctype="multipart/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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top