Re: File Upload Web Service

From: Alphonse Giambrone (NOSPAMa-giam_at_example.invalid)
Date: 04/13/04


Date: Tue, 13 Apr 2004 08:28:43 -0400

Thanks for the help Steven,

I was finally able to assemble what I wanted. I found that I could access
the uploaded files in a web service just the same as a web form.
It turned out to be so incredibly easy, I wonder if I am missing something.
I found that the Request.Files collection is accessible in both a web form
and web service. Don't know why I could not find any articles spitting that
out.
So, basically, I created a global function that has an HttpFileCollection as
an input parameter. I simply pass the Request.Files collection from either
my user web form or my 'automated' (for posting from my vba app) web form
to the class, which then saves the file(s) and notifies me via email.
I decided to use a web form for the vba post just so I would not need to
maintain another project for one simple task, but it would work just the
same if I had used a web service.
For security with my vba post, I concatenate login and password to the file
name (since my understanding is that additional data can not be included
with file posts), parse it out in my new function and check authentication
using all the same functions for normal site user login.
The 'automated' web form then sends a structured response that the vba app
can parse out to determine it the post was successful.

BTW, the article at
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebhttprequestclassfilestopic.asp?frame=true
is incorrect.
It states that the example "writes out the names of all files in the Files
collection".
What it actually writes out is the 'key' names.
To get the actual file name one must use:
Request.Files(arr1(loop1)).FileName

-- 
Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:fo69yxSIEHA.3220@cpmsftngxa10.phx.gbl...
> Thanks for Mike's informative suggestions.
>
> Hi Alphonse,
>
> As for the "a web service can accept http get and post, not just
SOAP/XML."
> you mentioned, here is my understanding on this:
>
> The HTTP POST /GET or SMTP are the actual transport protocal the
webservice
> message binded to, it can be defined and described in the WSDL of the
> webservice. And the SOAP/XML is the message format(how the content  are
> formatted in the message) of the webservice, they're difference from each
> other. In other word, SOAP/XML is the message infrastructure, which is
> based on the actual transport protocal, http post or http get or smtp.
....
>
> ---------------------------------------------------------
> SOAP/XML message body                                    //abstracted high
> level
> ---------------------------------------------------------
> http get | http get | smtp | other protocal               //fundamental
> implement
>
> Do you think so? In addition, as for implementing authentication mechanism
> in webservice, there're many buildin approachs in ASP.NET webservice such
> as integrated with IIS's authentication. Or defind some customer SOAP
> headers to provide the authentication token. Also, you can provide
> authentication token in every method call, that's the simplest means. :).
> Below is a former post  discussing the authentication in webservide in
> communty:
>
> # Web Service Security
>
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=9xA7M%23
>
THEHA.3800%40cpmsftngxa06.phx.gbl&rnum=1&prev=/groups%3Fq%3Dwebservice%2Bsec
> urity%2Bsteven%2Bcheng%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den
>
> Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>


Relevant Pages

  • Re: Trying to pass NetworkCredential to WebService
    ... authentication. ... ASP.NET's webservice calling code, we need to attach a NetworkCredential to ... application pool different from the ASP.NET ... So this still is a problem because my web service needs to run ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: User Security?
    ... The authentication is "Integrated Windows Authentication". ... Currently I am trying to access the web service thru IE6. ... you're developing an ASP.NET webservice which hosted ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Problem with web service credentials
    ... I guess you have impersonation turned on in you website and the webservice is on another computer. ... Implement Kerberos authentication. ... error stating that it is unauthorized to call the web service. ...
    (microsoft.public.dotnet.general)
  • Re: Security setting help required in web.config file.
    ... browser on machine3 to the web server on machine2. ... account synchronized with the web service machine. ... Authentication, Role-based Security, and SQL Reporting Services Web ... webservice is deployed in this machine. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: WinForms and WebServices
    ... The OP wants to create a WebService and a WebForms application to ... who will install the WebService on their Web servers. ... When that is installed your program can reference to that. ... So you say that I can change the web service URL in the config file at run ...
    (microsoft.public.dotnet.languages.vb)

Loading