Re: File Upload

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Sunil,

I’m not very familiar with C++. However, you can think about to build a
small .NET application to upload file. That will be easy for processing the
file on server-side. And it is not difficult to call the .NET program from
your C++ application.

Or you can make .NET component to perform upload file function, then call
the .NET component from COM
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/cominterop.asp).

HTH

Elton


"Neo" wrote:

> hi elton,
>
> the client is in C++
>
> The details are as follows. There is a desktop application in MFC, and
> i am building a web interface for that application in ASP.NET. I have
> to upload a file from the C++ Application to ASP.NET web application.
>
> I am using Multipart/form-data to transfer the file, as sending it as a
> HTTP request in synchronous mode hangs my C++ application. What is
> happening is that i am receiving the file on the server which i am
> storing to the disk using request.inputstream.
>
> What happens is that the boundary and the Content-Disposition :
> application/octet-stream comes in the binary inputstream which i am
> trying to filter. What i did was that i saved the file on the server
> and then read it line by line using streamreader and streamwriter, but
> it gives me some encoding problem.
>
> So i am looking at ... can a file be uploaded from C++ Desktop
> application to a ASP.NET web server application without the junk
> content in the stream, i.e. only the file (complete as it was sent), or
> is there any way to parse binary data??
>
> All help is appreciated ... thanks for the same.
>
> Regards
>
> Sunil
>
> Elton W wrote:
> > Hi Neo,
> >
> > You can try
> >
> > System.Web.HttpPostedFile file = Request.Files[0]; // suppose there is only
> > one file
> > //or
> > System.Web.HttpPostedFile file = Request.Files["file_name"];
> >
> >
> > On client-side you can use
> >
> > System.Net.WebClient client = new WebClient();
> > byte[] data = client.UploadFile(url,"POST",fileName);
> >
> > To send file to server.
> >
> >
> >
> > HTH
> >
> > Elton Wang
> > elton_wang@xxxxxxxxxxx
> >
> >
> >
> >
> > "Neo" wrote:
> >
> > > Hello,
> > >
> > > I am receiving a file as a binary stream from a C++ Client Application.
> > > >From the application, the file is being sent as a
> > > "Multipart/form-data".
> > >
> > > I want to receive this file on the server, for which i am using
> > > Request.Inputstream and reading it into a byte array. This is not
> > > working as it is coupling the binary content with some Boundary and
> > > text such as "Content-Disposition:
> > > form-data; name="upload_file"; filename="C:\dustbin\test.bin"
> > > Content-Type: "application/octet-stream"
> > >
> > > Is there any way in ASP.NET by which i can read a File being sent from
> > > an Application (not a HtmlInputFileControl), can be read, without the
> > > unnecessary data/ or any way in which i can filter the binary data.
> > >
> > > Please help, i am stuck big time on this. This feature is imperative
> > > for the project :(
> > >
> > > Requesting help.
> > >
> > > Regards
> > >
> > > Sunil Jambekar
> > >
> > >
>
>
.



Relevant Pages

  • Re: Upload files with wsgi
    ... don' t find how take an upload file i am using the wsgiref lib, ... theres any way to connect to the client in order to get the file by ... a web server will run it in response to web requests? ...
    (comp.lang.python)
  • Re: ftp upload from server to server
    ... I want to upload file from one server to another using some sort of ... php class or some another PEAR file? ... For now I have downloaded pear file from pear.php.net. ... I have dedicated server on windows OS. ...
    (comp.lang.php)
  • Re: Squirrelmail - Attachement
    ... Don't if you could help me, but I am sing Squirrelmail and I cannot upload file to send ... I can send mail with an attachment using Squirrelmail with no trouble. ... It appears that the mail is assembled on the client side, with the attachment, and so there is no special storage for it on the server. ...
    (linux.redhat)
  • Please help to find code uploading files from client to server
    ... I am a novice in jscript and vbscript. ... code to upload file from client computer to a directory at server. ...
    (microsoft.public.scripting.vbscript)
  • Please help to upload files from client to server
    ... I am a novice in jscript and vbscript ... Please help to find an example of code to upload file from client computer ... to a directory at server. ...
    (microsoft.public.scripting.jscript)