--- Christian Leicht <[EMAIL PROTECTED]> wrote:

> Yes i tried it this way, but have a problem.
> 
> My code (part):
> 
> =======
>    data="--" + boundary + nl
>    data = data + _
>        "Content-Disposition: form-data; name=""userfile""" + nl
> + nl + _
>        encodedFileName + nl
> 
> // add a 2nd variable
>    data="--" + boundary + nl
>    data = data + _
>        "Content-Disposition: form-data; name=""funktion""" + nl
> + nl + _
>        "test" + nl
> 
>    data = data + "--" + boundary + nl
> 
> 
>    data = data + _
>        "Content-Disposition: form-data; name=""bildbinary""; 
> filename=""" + _
>        encodedFileName + """" + nl +_
>        "Content-Type: image/jpeg" + nl + _
>        "Content-Length: " + FormatLen(lenb(rawdata)) + nl + _
>        "Content-Transfer-Encoding: binary" + nl + _
>        nl + rawdata + nl
> 
>    data = data + "--" + boundary + nl + nl
> ======
> 
> If i add a 2nd variable to it i became only the 2nd (test) to
> the 
> Server. The first userfile variable is not sending. And also
> the File is 
> not going to the server.
> 
> I think but can not discribe the problem with the """ or
> nl(linebreaks) 
> Syntax ?
> 
> I have between the parts set the boundarys, and it should be
> working.

One difference I notice between what the commercial browsers send
and what you are sending.

You are sending something that looks roughly like this:

Content-disposition=form-data; name=A
<"A" text>

Content-disposition=form-data; name=B
<"B" text>

Content-disposition=form-data; name=C; filename=blabla.jpg
Content-Type: image/jpeg
Content-Length: 12345
Content-Transfer-Encoding: binary
<"C" file data>

Notice there is no relation between the section for the "C" file
data and the part that comes immediately before it.  But when I
capture the output from a commercial browser, what I see is:

Content-disposition=form-data; name=A
<"A" text>

Content-disposition=form-data; name=B
<"B" text>

Content-disposition=form-data; name=C
<"C" text (file name)>

Content-disposition=form-data; name=C; filename=blabla.jpg
Content-Type: image/jpeg
Content-Length: 12345
Content-Transfer-Encoding: binary
<"C" file data>

Notice the last 2 sections: there are two sections that both have
the same name ("C") but the first one is just a plain text field
containing the file name and the second one has the extra
"Content-*" headers and the binary contents of the file.  For me,
it only worked when I sent both sections for each file: both have
the same name, but one has a plain text field containing the file
name, and the second has the binary data for the file.

The above examples are not valid HTTP headers--I left some things
out to make it a bit easier to read.  But hopefully that will
highlight the sections of the original code that you need to look
at.


Mark Nutter

Quick and easy regex creation and debugging!
http://www.bucktailsoftware.com/products/regexplorer/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to