Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Post file from server to another server - Urgent help required
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 i
n
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



Report this thread to moderator Post Follow-up to this message
Old Post
Badri Narayanan
03-30-05 08:55 PM


Re: Post file from server to another server - Urgent help required
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
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Sean
03-31-05 08:56 AM


Re: Post file from server to another server - Urgent help required
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... 
Receiver.asp. 
in 
it 
how??? 
to 
& 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Badri Narayanan
03-31-05 08:55 PM


Re: Post file from server to another server - Urgent help required
<<
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.examnotes.net ***

Report this thread to moderator Post Follow-up to this message
Old Post
Bullschmidt
03-31-05 08:55 PM


Re: Post file from server to another server - Urgent help required
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.examnotes.net ***



Report this thread to moderator Post Follow-up to this message
Old Post
Badri Narayanan
03-31-05 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:04 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.