.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

web service file download and upload

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net


I am trying to create a web service that can check a location for file and if available get the contents.

Also this web service has to upload the file using ftp after making changes locally.

Any pointers in this direction.



View Complete Post

More Related Resource Links

File Upload to database (and download)



How can I upload a file to a database (with as little code as possible!) along with a desciption of a file and then search through the descriptions to retrieve the appropriate files. Then how can I click on one and download it.

I am not a very advanced programmer and would like full step by step code if possible not just a link to a website.

Thank you very much


how to set a client folder to get upload and download the file.


i create a web site for uploading and download but i require that a folder create in client side if client download the file these file automatically save 

Download file from service and tracking ?? wcf help


hi all,

 Have developed a wcf download application,where the client downloads a file from the service.It also supports Resume function.Binding used is BasicHttpBinding.

I want the following in my application and need an idea on the same:-

* a folder at the service is tracked for new files or changes.A new file when in the folder,is to be sent to the client(ie downloaded).

 Now here,it is the service who needs to indicate the client when it receives  a new folder.And then the client downloads it.For this ,i will have to use HttpDuplex (callbacks).right??

But ,is HttpDuplex a better option??..will it work fine ?? has HttpDuplex has some problem with ports used and firewals and others??..I have no idea and end up guessing .!!!

Is there any other binding  that i can use,so that the service informs client about a arrival of a new file ,so that the client downloads it??

what about using net.tcp endpoint to inform the client of the new file and using BasicHttp to download file to the client?i mean 2 endpoints at service??

My criteria is the downloading should be via http and port 80.!!

Can anyone give me a clear solution..Im looking for it...do plz let me know what i can do to achieve the above..Waiting for an answer...



Mumtaz Surani

File/document upload.download in a web farm


I have an asp.net application running on a web farm that allows users to upload files and download them later via link to that file.  Currently, I use Windows DFS to replicate the local IIS directory where the files are stored across the web farm servers.  However, as this solution does not scale out, I want to implement a more scalable solution by partitioning the documents.  Specifically, say I set up multiple file storage servers (Fs1, Fs2, Fs3, etc.) on the network.  Further, let's say I change my upload page to save the uploaded file to one of the file storage servers on the local LAN (based on some logic).  I assume so far I am safe with ASP.NET doing this much assuming I have the correct permission for the ASP.NET process ID.  The question I have is with regards to download links.  When a user gets served a download link to their document (e.g. http://www.testco.com/data/doc1.txt) is there a way for me to "intercept" that HTTP request and underneath the covers server the doc1.txt from the file storage server (e.g. Fs2) it resides on?  Any sample code would be appreciated.  Thanks. 

How can i solve this issue wcf upload/download service ?? !!


Hi wcf guys,

 Iam into a problem and i really want you guys to give me an idea to solve my problem as soon as possible with the most easiest way possible..Problem given below : 

 Have created a wcf service that uploads and downloads files and folders to the client using basicHttpBinding.As we all know that as it is wcf it can be used in WAN or through the internet as well...Now if i host my service on a server and i have a firewall on which a static ip is configured which can be accessed by outsiders ......Suppose my static ip is and i acess my service through this ip from anywhere ,iam able to do so...

  My aplication uploads  files so the source willl be a local folder path that is to be uploaded and my destination is "\\server-ip\Sharedfolder"..so that my folder gets uploaded to the shared folder that is on the server.

  The PROBLEM is , as iam using the application in WAN and i access the service through static ip (obviously) ,what will be my destination for uploading ?? as i CANNOT have or access a shared folder on WAN !! In this case how will the uploading feature work in WAN?? what do i need to do now??Iam not allowed to create a shared folder and publicly access it,therefore my uploading destination folder cannot be created or accessed..


Please do give me a clear

How to Download a Large File from a WCF Service?

How to download a large file from a WCF Service?
I am getting error while transferring a large file from WCF service to client?
How to send large messages or data from WCF Service to a client?

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

file upload in chunks or not buffering in memory before writing to disk?


What are the options for handling file uploads to reduce the memory footprint?  Is there a way to upload in chunks?  Is there a way to stream upload directly to disk instead of loading entire file in server memory?


upload file not working



iam using masterpage and ajax update panel, i have child page called  fileupload.aspx,i try to upload the file

but its not working , can i use updatepanel in child page , pls very urgent

looking forward for answer.

how to know when a user finish his file download successfully ?


hi all

i am doing a page to sell files online

 the paying method is by a card or bank account and the customer is not registered to the site so i want to make sure that the customer has downloaded the file successfully after that the system completes the payment operation

so if there is any way to know do that tell me please

i use c# thanx all



file upload in Create User Wizard Created User event with UpdatePanel Tag wont work?



In my Create User Wizard1 Created User Wizard Event, I am collecting extra information from text boxes and allowing

the user to uplad a file.



I have put the Submit button within an Update Panel Tag but since I have done this it does not work.

Is there a way round it. In this situation would you use a trigger.?


<br />

  <asp:UpdatePanel ID="UpdatePanel2" runat="server">

  <asp:Button ID="StepNextButton" runat="server"  CommandName="MoveNext"  align="middle"
                                            Text="Submit my Profile" />

File Download Problem


Hi everyone,

I am using a download handler to handle the downloading of files from my website.  I am using a slightly modified code from the Microsoft article http://support.microsoft.com/kb/812406

Everything is working fine and downloading, even with large files, but it does not show the file size for any of the files to download. Even if theyre really small.

Here is my code for the handler

public class DownloadHandler : IHttpHandler

        public void ProcessRequest(HttpContext context)
            string path = "";
                path = context.Server.UrlDecode(context.Request.QueryString["src"]).DecryptString();
            catch(Exception ex)
            System.IO.Stream iStream = null;

            byte[] buffer = new Byte[10000];

            int length;

            long dataToRead;

            string filename = System.IO.Path.GetFileName(path);

                iStream = new System.IO.FileStream(context.Server.MapPath("~/" + path), System.IO.FileMode.Open,
                            System.IO.FileAccess.Read, System.IO.FileShare.Read);


Problem download file from SQL Server


Hello everyone. I am having an issue downloading files that I have store in SQL Server. I have no problem in a WinForm. What am I doing wrong in my code?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim sch As New clsReport
        Dim fileData As New clsReport.Letter
        fileData = sch.DownloadLetter(Session("LetterID"))
        Dim ms As System.IO.MemoryStream = fileData.fil

        Dim fil As Byte() = ms.ToArray
        Dim nam As String = fileData.name
        Dim ext As String = fileData.ext
        If Not fil Is Nothing Then
                ' Response.Clear()
                Response.AppendHeader("Content-Disposition", "attachment; filename=" + nam & "." & ext)
                ' Response.AddHeader("Content-Disposition", nam & "." & ext)
                Response.AddHeader("Content-Length", fil.Length.ToString)
                Response.ContentType = "Application/octet-stream"
                Response.Buffer = True
            Catch ex As Exception
            End Try

        End If

    End Su

The file reached the maximum download limit. Check that the full text of the document can be meaning



I'm facing an issue with the indexing.

I have 1 WFE+Index server+DB server.

Index server is not installed with MS FIlter pack 1.0

When crawling, the there will be document with warning in crawl log:
The file reached the maximum download limit. Check that the full text of the document can be meaningfully crawled.

Documents that with warning are such as doc, ppt, xls, docs, ppts and many others.
However, I view into the successful crawled document, there are doucments with ext doc and ppt.

For large file index, there are MaxGrowthFactor + MaxDownLoadSize required to be added into the index server.

As my understanding is, MS Filter Pack should installed into index server(already did, correct me if i'm wrong).

I looked into the Office SharePoint Seach(CA>Services in farm), if the server is appointed to "Use this server as indexing server", then MS Filter Pack is suppose to be installed into that particular server as well.

At the bottom, there also has another option is "Use all web front end for crawling".

The question here is, IF the option "Use all web front end for crawling" is selected.
Does the WED FRONT END Server required to installed the Ms Filte

Asp.Net upload file access denied



I have the problem below, if anyone can help me, appreciate it.

Server Error in '/' Application.

Access to the path 'c:\Inetpub\EnewsAttFiles\employ-e-header2.jpg' is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'c:\Inetpub\EnewsAttFiles\employ-e-header2.jpg' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Hig
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend