473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

File Upload Web Service

I am trying to develop a web service to accept a file uploaded via http post
from a vba (Access) application.
Thanks to helpful links in a vb newsgroup and my previous work with WinInet
api I was able to write the code to do the upload. I know this works because
I tested by posting to an asp page that saves the file.
Now I need to create a .NET web service to accept and save the file. Of all
the web service samples I found, the only ones that deal with file upload
receive the file as a byte array from another .net object (like a webform).
How can I access the http post and extract the uploaded file in a web
service.
Or if that is not possible, how about from a aspx page?

TIA

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us

Nov 18 '05 #1
5 6454
Hi Alphonse,

From your description, you are wanting to generate a webserivie or a
webform page which can help process the uploaded file postd from a
client(OFFICE VBA ?).

As for this question, here are my suggestions:
1. If use WebService, it is general that we define a certain webmethod
which takes a byte array param and a string param such as
pubic void UploadFile(bytes as Byte() , filename as String)

And then, we can easily call it in .NET application since we can use the
WSDL.EXE or the VS.NET to generate a easytouse client proxy class.

However, since you'd like to call the webservice in VBA application, I
think two mean in VBA can help to call webservice:
a) use MXXML COM component to send raw XML soap message, this will have us
to write the soap http message manually and post it via XMLHTTP component.

b) There is a webservice add-in in OFFICE which can help to generate a
webservice proxy. I think this will be more convenient. You may have a
search in MSDN to see whether the certain ADD-IN will help.
2. In addition to webservice, I think a simple asp.net webform page is also
capable of handling client uploaded file. The ASP.NET 's butildin
Request(HttpRequest class) object has a "Files" member which can help to
handle the client uploaded files. Here are some references on the
HttpRequest.Files member and handle upload files in ASP.NET:
#HttpRequest.Files Property
http://msdn.microsoft.com/library/en...webhttprequest
classfilestopic.asp?frame=true

#Uploading Files Using the File Field Control
(this article is focus on use webform to upload, but you can also get ideas
on how to handle the file steam from other clients)
http://msdn.microsoft.com/library/en...eupload.asp?fr
ame=true

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


Nov 18 '05 #2
Hi Alphonse,

For Office XP & 2003 VBA Web service development, Microsoft has released Office web service Toolkit which will provide some assistance on your
scenario.
Microsoft Office 2003 Web Services Toolkit 2.01
http://www.microsoft.com/downloads/d...DisplayLang=en

Microsoft Office XP Web Services Toolkit 2.0
http://www.microsoft.com/downloads/d...displaylang=en

Some MSDN technique articles will introduce more info regarding this.
Microsoft Office XP Web Services Toolkit
http://msdn.microsoft.com/library/en...itoverview.asp

Please feel free to let me know if you have any further questions.

Best Regards,
Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Nov 18 '05 #3
Thanks both for the replies.

The Office toolkits are not an option. I should have mentioned that I am
using vba with wininet api for the upload because I need the solution to
work with Access 97 and up without any additional references or installs. It
is pretty safe to assume my users have IE and therefore wininet.dll.

It seems that you are saying I can't post the file to a web service, but can
to a web page. This would be ok if need be, but I would prefer using a web
service.
Am I understanding this correctly?

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:yJ**************@cpmsftngxa06.phx.gbl...
Hi Alphonse,

From your description, you are wanting to generate a webserivie or a
webform page which can help process the uploaded file postd from a
client(OFFICE VBA ?).

As for this question, here are my suggestions:
1. If use WebService, it is general that we define a certain webmethod
which takes a byte array param and a string param such as
pubic void UploadFile(bytes as Byte() , filename as String)

And then, we can easily call it in .NET application since we can use the
WSDL.EXE or the VS.NET to generate a easytouse client proxy class.

However, since you'd like to call the webservice in VBA application, I
think two mean in VBA can help to call webservice:
a) use MXXML COM component to send raw XML soap message, this will have us
to write the soap http message manually and post it via XMLHTTP component.

b) There is a webservice add-in in OFFICE which can help to generate a
webservice proxy. I think this will be more convenient. You may have a
search in MSDN to see whether the certain ADD-IN will help.
2. In addition to webservice, I think a simple asp.net webform page is also capable of handling client uploaded file. The ASP.NET 's butildin
Request(HttpRequest class) object has a "Files" member which can help to
handle the client uploaded files. Here are some references on the
HttpRequest.Files member and handle upload files in ASP.NET:
#HttpRequest.Files Property
http://msdn.microsoft.com/library/en...webhttprequest classfilestopic.asp?frame=true

#Uploading Files Using the File Field Control
(this article is focus on use webform to upload, but you can also get ideas on how to handle the file steam from other clients)
http://msdn.microsoft.com/library/en...eupload.asp?fr ame=true

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


Nov 18 '05 #4
You'll have to remember that a webservice uses SOAP/XML for all method
post/requests. While you can certainly encode a file to send through a web
service (e.g. a byte array, or otherwise) I think you'll find much better
built in support to older office files for doing a more standard file post
over http.

You can create a very basic web page... just a class that descends from the
Page class, and on the Page load event, you can check for the files being
uploaded. It sounds like you already have that working on the office/client
side -- getting it to work on the server side should be easy.

I wonder, then, why you are wanting to use the web service? I guess
Microsoft has done a lot of marketing work on how great web services are --
but if the client can't easily consume the web service, it's not much use.

That's just my two cents.

--
Mike Mayer, C# MVP
mi**@mag37.com
http://www.mag37.com/csharp/
"Alphonse Giambrone" <NO**********@example.invalid> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Thanks both for the replies.

The Office toolkits are not an option. I should have mentioned that I am
using vba with wininet api for the upload because I need the solution to
work with Access 97 and up without any additional references or installs. It is pretty safe to assume my users have IE and therefore wininet.dll.

It seems that you are saying I can't post the file to a web service, but can to a web page. This would be ok if need be, but I would prefer using a web
service.
Am I understanding this correctly?

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:yJ**************@cpmsftngxa06.phx.gbl...
Hi Alphonse,

From your description, you are wanting to generate a webserivie or a
webform page which can help process the uploaded file postd from a
client(OFFICE VBA ?).

As for this question, here are my suggestions:
1. If use WebService, it is general that we define a certain webmethod
which takes a byte array param and a string param such as
pubic void UploadFile(bytes as Byte() , filename as String)

And then, we can easily call it in .NET application since we can use the
WSDL.EXE or the VS.NET to generate a easytouse client proxy class.

However, since you'd like to call the webservice in VBA application, I
think two mean in VBA can help to call webservice:
a) use MXXML COM component to send raw XML soap message, this will have us to write the soap http message manually and post it via XMLHTTP component.
b) There is a webservice add-in in OFFICE which can help to generate a
webservice proxy. I think this will be more convenient. You may have a
search in MSDN to see whether the certain ADD-IN will help.
2. In addition to webservice, I think a simple asp.net webform page is

also
capable of handling client uploaded file. The ASP.NET 's butildin
Request(HttpRequest class) object has a "Files" member which can help to
handle the client uploaded files. Here are some references on the
HttpRequest.Files member and handle upload files in ASP.NET:
#HttpRequest.Files Property

http://msdn.microsoft.com/library/en...webhttprequest
classfilestopic.asp?frame=true

#Uploading Files Using the File Field Control
(this article is focus on use webform to upload, but you can also get

ideas
on how to handle the file steam from other clients)

http://msdn.microsoft.com/library/en...eupload.asp?fr
ame=true

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



Nov 18 '05 #5
Thanks for your response Mike.
Yes, you are correct. After all I have read about web services, it just
seemed like the right thing to use since the process will not require any
human intervention other than to agree to the upload. Plus, I have also read
that a web service can accept http get and post, not just SOAP/XML.
Once I get the upload process working I will need to implement some security
and thought it might be easier using a web service to pass a token to my vba
app which would then include it with the file to provide authentication.

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Michael Mayer [C# MVP]" <mi**@mag37.com> wrote in message
news:up**************@TK2MSFTNGP11.phx.gbl...
You'll have to remember that a webservice uses SOAP/XML for all method
post/requests. While you can certainly encode a file to send through a web
service (e.g. a byte array, or otherwise) I think you'll find much better
built in support to older office files for doing a more standard file post
over http.

You can create a very basic web page... just a class that descends from the Page class, and on the Page load event, you can check for the files being
uploaded. It sounds like you already have that working on the office/client side -- getting it to work on the server side should be easy.

I wonder, then, why you are wanting to use the web service? I guess
Microsoft has done a lot of marketing work on how great web services are -- but if the client can't easily consume the web service, it's not much use.

That's just my two cents.

--
Mike Mayer, C# MVP
mi**@mag37.com
http://www.mag37.com/csharp/
"Alphonse Giambrone" <NO**********@example.invalid> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Thanks both for the replies.

The Office toolkits are not an option. I should have mentioned that I am
using vba with wininet api for the upload because I need the solution to
work with Access 97 and up without any additional references or installs.
It
is pretty safe to assume my users have IE and therefore wininet.dll.

It seems that you are saying I can't post the file to a web service, but can
to a web page. This would be ok if need be, but I would prefer using a web service.
Am I understanding this correctly?

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:yJ**************@cpmsftngxa06.phx.gbl...
Hi Alphonse,

From your description, you are wanting to generate a webserivie or a
webform page which can help process the uploaded file postd from a
client(OFFICE VBA ?).

As for this question, here are my suggestions:
1. If use WebService, it is general that we define a certain webmethod
which takes a byte array param and a string param such as
pubic void UploadFile(bytes as Byte() , filename as String)

And then, we can easily call it in .NET application since we can use the WSDL.EXE or the VS.NET to generate a easytouse client proxy class.

However, since you'd like to call the webservice in VBA application, I
think two mean in VBA can help to call webservice:
a) use MXXML COM component to send raw XML soap message, this will have us to write the soap http message manually and post it via XMLHTTP component.
b) There is a webservice add-in in OFFICE which can help to generate
a webservice proxy. I think this will be more convenient. You may have a
search in MSDN to see whether the certain ADD-IN will help.
2. In addition to webservice, I think a simple asp.net webform page is

also
capable of handling client uploaded file. The ASP.NET 's butildin
Request(HttpRequest class) object has a "Files" member which can help to handle the client uploaded files. Here are some references on the
HttpRequest.Files member and handle upload files in ASP.NET:
#HttpRequest.Files Property

http://msdn.microsoft.com/library/en...webhttprequest
classfilestopic.asp?frame=true

#Uploading Files Using the File Field Control
(this article is focus on use webform to upload, but you can also get

ideas
on how to handle the file steam from other clients)

http://msdn.microsoft.com/library/en...eupload.asp?fr
ame=true

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




Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jonathan | last post by:
I am trying to upload a new version of a file that already exists on my web site. It asks me to overwrite and I choose yes. But when I go to the web page, even a half hour after the upload, the...
2
by: Andy Johns | last post by:
I've seen plenty of examples of file uploads in ASP.NET when the only form element is the file input type, but I've not seen a practical example of a file upload routine running alongside other...
10
by: Alphonse Giambrone | last post by:
I am trying to develop a web service to accept a file uploaded via http post from a vba (Access) application. Thanks to helpful links in a vb newsgroup and my previous work with WinInet api I was...
6
by: Pat Carden | last post by:
Hi, We need to allow webusers to upload a file on our website (on Server3, all servers run Server 2003, remotely hosted) and eventually save it on our SBS Server (Server2) which is not exposed...
3
by: Pitcairnia | last post by:
The basic purpose of the site is for authenticated users to post event listings, which often include photographs. The user is faced with a page where they can insert all of the information about...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
1
by: John Wolff | last post by:
I’m trying to upload a file to a Web Service. I have to submit the file using a standard HTML form with the <input type=“file” /tag. Ultimately, we are submitting the file from a Flash 8...
7
by: russell.lane | last post by:
I've been looking at both MTOM and simple HTTP POST or PUT for file uploads. Some relevant details: ... We want to support programmatic file uploads from Winform apps. ... The files are large...
0
by: mfsiddiq | last post by:
HI I would like to know how to upload a file using web service.I am using hessian webservice,and i need to upload a file to the server.Flex uses file reference.upload for upload which uses http...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.