Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Strange 20 MB file transfer limit using a web service

Posted on 2006-10-31
3
Medium Priority
?
962 Views
Last Modified: 2012-06-21
We have created a web service that transfers files over http.  It does this by reading the file and returning the file object via a soap message.  This web service is installed on a windows 2003 server running IIS 6.0.  The web service works well with smaller file sizes but as soon as you attempt to transfer a file larger than 20 MB, it downloads the first 20 MB and then stops with no errors.  The web service learns the path to the file via a third party SQL database and then accesses the files via a windows file share, for example - \\servername\sharename\filename.txt.  This web service is working without these issues in our staging and development environments.  This only happens in production.

Now for some of the strangeness.  First, we tried installing the web service on a windows XP Pro computer and it works fine with files larger than 20 MB.  We then tried changing the path in the SQL database to use the local drive letter instead of a file share, for example - F:\folder\filename.txt.  That seems to have solved the issue in production but we are not able to make that change permanently to the paths due to the third party app that uses them.  This is making us think that the issue is in the method of transfer somehow but we are at a loss as to why.

Here is the code in the web service.

<WebMethod()> _

   Public Function getImageByPath(ByVal filePath As String) As [Byte]()

        Dim fs As FileStream

        Try

            ' Read file and return contents

            fs = File.Open(filePath, FileMode.Open, FileAccess.Read)

            Dim lngLen As Long = fs.Length

            Dim abytBuffer(CInt(lngLen - 1)) As Byte

            fs.Read(abytBuffer, 0, CInt(lngLen))

            Return abytBuffer

        Catch exp As Exception

            Return Nothing

        Finally

            If Not fs Is Nothing Then

                fs.Close()

            End If

        End Try

    End Function

0
Comment
Question by:denverjaye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Expert Comment

by:kmartin7
ID: 17845552
We had a similar issue with an application we created for the military. The problem was they had several reverse proxies that limited the transfer to a pre-specified amount (varied depending on owner). The real problem was there were few people that knew of the problem and it was difficult to find since they all had a different size limitation. We had to re-develop the application so that it sent compressed, 5MB chunks of data that decompressed and recompiled at the receive site. Not exactly the same issue, but maybe it might help shed some light on your issue.
0
 
LVL 1

Expert Comment

by:rajeev1972
ID: 17850910
In place of giving
\\servername\sharename\filename.txt

put

\\ip address\sharename\filename.txt

0
 
LVL 1

Accepted Solution

by:
gderoeck earned 2000 total points
ID: 17863916
I ran into an issue in a .NET application a while back where file transfers were getting terminated before the entire transfer was completed.  I was finally able to resolve the issue by using a FileStream, BinaryReader and BinaryWriter to perform the transfer, rather than just using the File.Open method you're using above.  The next step, as mentioned above, would be to buffer the transfer to smaller chunks to make the transfer more manageable.

Microsoft goes into some detail on Streams and how they interface with the Backing Store, whether it be a hard drive, network location, or memory.  You can find that article at:   http://msdn2.microsoft.com/en-us/library/e4y2dch9.aspx 
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question