File Transfer to an ASP page on a server

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating an application in .NET CF that needs to upload log files to an
ASP (not ASP.NET) page that currently exists on my server. I was hoping for
an application like XFIle (by software artisans, www.softartisans.com), but
can't seem to find anything for .NET CF. I can always backpedal and create an
FTP Site on my server, but I would really like the ASP page to make the
decision to store the file. Being relatively new to the .NET platform (and
having a deadline quickly approaching), I need help. Does any have any idea
how I might accomplish this task? I can include the source for my ASP page if
any needs to see it.
 
Thanks for the reponse. I've downloaded the code, and am runnning it on the
emulator. The upload succeeds when using the default text file and target url
(http://www.alexfeinman.com/uploadtest). My question is this: Does this
program upload the respective file to a virtual directory "uploadtest" or
does it upload to an asp page?
 
It uses PUT verb, so the target is a directory (Write needs to be enabled on
it).
An alternative approach would be using POST that contains binary file data.
On the receiving side it is easiest to implement the acceptor in .NET since
there is a built-in support for file uploads
 
Thanks for the response Alex! Do you know of any examples that uses a POST to
an ASP (Not ASP.NET) page? I already have a VB6 client app that uploads to
the same ASP page (which uses an ActiveX control). I'd really like to use the
same page if possible for both PC and .NET CF apps. Another alternative is to
use ASP.NET as you mentioned, which I haven't used yet.
 
Sorry, I should have actually looked at the code inside before making
assumptions :-(

Peter
 
If your ASP page already supports upload, you can simply reuse it. My point
was that if you were to write it from the scratch, it would have been easier
to do in ASP.NET.

On the client side you need to:
1) Set request method to POST
2) Set request content type to "application/x-www-form-urlencoded"
3) Set Request.Headers("Content-Disposition") to "attachment;
filename=fname.ext"
4) Obtain RequestStream and write your file to it.
5) Proceed with getting response
 
Back
Top