473,395 Members | 1,442 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,395 software developers and data experts.

Upload / Download via WebService

Hi

My application consists of a database, WebService and web application. The
web application reads and writes data to the database via the WebService. I
also want to be able to upload/download files via the WebService because my
WebService handles security.

My question is - how can this best be done? After some googleing a solution
I found was to stream bytes in a method like this:

<WebMethod()> _
Public Function UploadFile(ByVal docbinaryarray As Byte(), ByVal docname
As String) As Boolean
Dim strdocPath As String
strdocPath = "C:\Inetpub\wwwroot\FileUploadDownloadSvc\temp \" +
docname
Dim objfilestream = New System.IO.FileStream(strdocPath,
System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite)
objfilestream.Write(docbinaryarray, 0, docbinaryarray.Length)
objfilestream.Close()
Return True
End Function
Will this handle large files? Is this the best way to do it or is there
another better solution?

Many thanks!

Julia Beresford
Nov 30 '05 #1
1 2584
Julia

There are a number of options you can use for transmitting large
amounts of binary data. The solution you've listed (known as
base-64-encoding) is an okay solution. Your data will be transmitted
properly and it will be contained within your SOAP envelope (meaning
that you can use things like WS-Security) if you want. It is a highly
interoperable and composable solution. The downside is that it isn't a
very efficient solution. Base 64 encoding of your binary data results
in it bloating up anywhere from 33-100% during the transmission. If you
are planning on transmitting large amounts of data quickly, then you
might potentially run into some performance and latency issues.

There are some other options out there such as DIME and SOAP with
Attachments (SwA). But both of these have issues of their own. The
solution I currently recommend people looking closely at is using
Message Transmission Optimization Mechanism (MTOM). MTOM comes with the
Web Services Enhancements 3.0 from Microsoft. It's a really easy to use
technology that avoids a lot of the pitfalls of the other options.

I've written a brief overview of the different solutions and
specifically MTOM. You can check it out at
http://peterkelcey.com/pk_blog/index.php?m=20051119

I'd also suggest checking out the following article on MSDN
http://msdn.microsoft.com/library/de...opaquedata.asp

Hope that helps

Peter Kelcey

Nov 30 '05 #2

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

Similar topics

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...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
3
by: Demetri | last post by:
Hello, I'm involved in developing an application which has the need to transfer files automtically once a laptop is connected back to the network. The application i'm developing will...
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...
0
by: Roland Riess | last post by:
Hi, as an absolute web and configuration beginner I am stuck with a problem and so I finally seek your help again: Development tools: ASP.NET 1.1, C#, VS 2003, Windows 2000 SP4, IIS 5.0 I...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
7
by: dragiton | last post by:
SA Upload SQL Database variable types (image upload and storage) I am having trouble with the SA Upload utility. The following code used to work correctly. However, I lost my database and had to...
2
dlite922
by: dlite922 | last post by:
I have an intranet LAMP server and I use PHP to upload files. It is of course faster to download the same file than to upload it. I understand ISPs throttle their network for download speed, than...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.