Re: File Upload Web Service
From: Alphonse Giambrone (NOSPAMa-giam_at_example.invalid)
Date: 04/13/04
- Next message: Scott Allen: "Re: reusing codebehind files?"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: Debug/release ASP pages?"
- In reply to: Steven Cheng[MSFT]: "Re: File Upload Web Service"
- Next in thread: Steven Cheng[MSFT]: "Re: File Upload Web Service"
- Reply: Steven Cheng[MSFT]: "Re: File Upload Web Service"
- Messages sorted by: [ date ] [ thread ]
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 >
- Next message: Scott Allen: "Re: reusing codebehind files?"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: Debug/release ASP pages?"
- In reply to: Steven Cheng[MSFT]: "Re: File Upload Web Service"
- Next in thread: Steven Cheng[MSFT]: "Re: File Upload Web Service"
- Reply: Steven Cheng[MSFT]: "Re: File Upload Web Service"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|