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 5 6463
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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |