I accept a few user inputs and a file from the user, post it to my ASP page.
I'm able to receive the data as well as the file properly in Receiver.asp.
In my receiver.asp, I need to process the user inputs and subsequently POST
this data and the file again to a different server. I would like to use
ServerXMLHttp. Now, how do I simulate Form creation in receiver.asp.

I use the following code to post to the second server
MyXmlHttp.open "post", myTargetURL,false
MyXmlHttp.setRequestHeader "Content-Type", "multipart/form-data"

Now here's where I get stuck.
1) How do I construct the form data? How can I put together the data i
received (which is text) as well as the received file (which is Binary) in
the same Send statement for the Post? -- I assume that if HTML forms do it in
some format, I should be able to simulate the same through ASP, but how???

2) The received file will not be stored anywhere in my server. It has to
be forwarded in memory.

Should it look somewhat like the following?
MyXmlHttp.send ("userId=" & someUserId & "&privateLabelID=" & someLabel &
"&File=" & receivedBinaryFileInMemory)

Thanks in advance for any help

Re: Post file from server to another server - Urgent help required by Sean

Sean
Thu Mar 31 00:22:41 CST 2005

Can you show the code in Receiver.asp so we can help you?

Sean

"Badri Narayanan" <BadriNarayanan@discussions.microsoft.com> wrote in
message news:6985BA85-EA88-4D9E-A6A4-A8534E240BFD@microsoft.com...
>I accept a few user inputs and a file from the user, post it to my ASP
>page.
> I'm able to receive the data as well as the file properly in Receiver.asp.
> In my receiver.asp, I need to process the user inputs and subsequently
> POST
> this data and the file again to a different server. I would like to use
> ServerXMLHttp. Now, how do I simulate Form creation in receiver.asp.
>
> I use the following code to post to the second server
> MyXmlHttp.open "post", myTargetURL,false
> MyXmlHttp.setRequestHeader "Content-Type", "multipart/form-data"
>
> Now here's where I get stuck.
> 1) How do I construct the form data? How can I put together the data i
> received (which is text) as well as the received file (which is Binary) in
> the same Send statement for the Post? -- I assume that if HTML forms do it
> in
> some format, I should be able to simulate the same through ASP, but how???
>
> 2) The received file will not be stored anywhere in my server. It has to
> be forwarded in memory.
>
> Should it look somewhat like the following?
> MyXmlHttp.send ("userId=" & someUserId & "&privateLabelID=" & someLabel &
> "&File=" & receivedBinaryFileInMemory)
>
> Thanks in advance for any help
>
>



Re: Post file from server to another server - Urgent help required by Badri

Badri
Thu Mar 31 07:10:05 CST 2005

Sean... thanks for your time and interest. We've cracked it.
Badri
"Sean" <snorlaxnet@hotmail.com> wrote in message
news:RGM2e.859356$8l.658155@pd7tw1no...
> Can you show the code in Receiver.asp so we can help you?
>
> Sean
>
> "Badri Narayanan" <BadriNarayanan@discussions.microsoft.com> wrote in
> message news:6985BA85-EA88-4D9E-A6A4-A8534E240BFD@microsoft.com...
> >I accept a few user inputs and a file from the user, post it to my ASP
> >page.
> > I'm able to receive the data as well as the file properly in
Receiver.asp.
> > In my receiver.asp, I need to process the user inputs and subsequently
> > POST
> > this data and the file again to a different server. I would like to use
> > ServerXMLHttp. Now, how do I simulate Form creation in receiver.asp.
> >
> > I use the following code to post to the second server
> > MyXmlHttp.open "post", myTargetURL,false
> > MyXmlHttp.setRequestHeader "Content-Type", "multipart/form-data"
> >
> > Now here's where I get stuck.
> > 1) How do I construct the form data? How can I put together the data i
> > received (which is text) as well as the received file (which is Binary)
in
> > the same Send statement for the Post? -- I assume that if HTML forms do
it
> > in
> > some format, I should be able to simulate the same through ASP, but
how???
> >
> > 2) The received file will not be stored anywhere in my server. It has
to
> > be forwarded in memory.
> >
> > Should it look somewhat like the following?
> > MyXmlHttp.send ("userId=" & someUserId & "&privateLabelID=" & someLabel
&
> > "&File=" & receivedBinaryFileInMemory)
> >
> > Thanks in advance for any help
> >
> >
>
>



Re: Post file from server to another server - Urgent help required by Bullschmidt

Bullschmidt
Thu Mar 31 07:10:38 CST 2005

<<
I accept a few user inputs and a file from the user, post it to my ASP
page.
I'm able to receive the data as well as the file properly in
Receiver.asp.
In my receiver.asp, I need to process the user inputs and subsequently
POST
this data and the file again to a different server.
>>

To submit a form is a client-side thing to do.

You could have a page with a bunch of hidden fields filled with info
that immediately gets submitted with JavaScript like this toward the
bottom of the page:

<script type='text/javascript'>document.myform.submit();</script>

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***

Re: Post file from server to another server - Urgent help required by Badri

Badri
Thu Mar 31 07:24:47 CST 2005

Thanks for the reply...

As I have mentioned in my post, I need to process some data and the file
input by the user, add my own stuff to the form, and post it to a different
domain. The requirement is that all this processing has to happen at the
server side only. If it is only data (which is just text and no file
attached), this works to perfection using ServerXMLHttp . I was trying to
figure out how this can be achieved with data as well as an attached File in
the Form. The "file attachment" makes the entire Form data to be binary.

While I think I have worked out a solution, I think there are other issues
that I need to comprehend. I'm currently putting it all together

Thanks
Badri

"Bullschmidt" <paul@bullschmidt.com-nospam> wrote in message
news:OHoaJMfNFHA.576@TK2MSFTNGP12.phx.gbl...
> <<
> I accept a few user inputs and a file from the user, post it to my ASP
> page.
> I'm able to receive the data as well as the file properly in
> Receiver.asp.
> In my receiver.asp, I need to process the user inputs and subsequently
> POST
> this data and the file again to a different server.
> >>
>
> To submit a form is a client-side thing to do.
>
> You could have a page with a bunch of hidden fields filled with info
> that immediately gets submitted with JavaScript like this toward the
> bottom of the page:
>
> <script type='text/javascript'>document.myform.submit();</script>
>
> Best regards,
> J. Paul Schmidt, Freelance ASP Web Developer
> http://www.Bullschmidt.com
> ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
>
>
> *** Sent via Developersdex http://www.developersdex.com ***