.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

Silverlight Uploading Large File to a ListItem Erroring Out

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :SharePoint

Hi everyone,


Having a problem when trying to upload a large file like say 4 megs for a list item via a Silverlight webpart, it is using the Silverlight Client Object Model, I keep getting the following error "The remote server returned an error: NotFound.".


It's fine for small files.


I've already gone into central admin to see if I can adjust the max upload size, and I've increased it, looked at web.config and increased it as well, recycled the app pool, restarted the website, done everything.


What could be wrong?




View Complete Post

More Related Resource Links

Uploading Large File (40mb) fails... (webhttpbinding) (Azure)

I'm using javascript to upload a file to my WCF service hosted on Azure.  (40 mb file) Here is the snippets from the web.config for the service: <system.serviceModel> <bindings> <webHttpBinding> <binding transferMode="Streamed" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" openTimeout="00:25:00" closeTimeout="00:25:00" sendTimeout="00:25:00" receiveTimeout="00:25:00" name="WebConfiguration"> </binding> </webHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="RestfulEndpointBehavior"> <webHttp/> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="CPUploadServiceBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl=""/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <services> <service name="CPUpload" behaviorConfiguration="CPUploadServiceBehavior"> <endpoint add

Large file support for WCF + Silverlight 4


I've seen some of the answers but nothing is really working - here is the issue, I drag a small image to a Silverlight browser application I created and it uploads to my server just fine - I then try and do this for a larger file - in this case its a .xap file that's bigger (100K). And I get an error "The remote server returned an error: NotFound." I know some default limits exists - 64K maybe

What I did do was use a Silverlight enabled WCF service (won't be using RIA) - but I hit this problem immedatly. So I decided to browes for an answer (yes, I've seen Shawn Wildermuths site and other answers) - I added a <system.serviceModel> section to my web.debug.config and added some settings I pulled off the web (still ramping up with WCF) and "assumed" it would fix the problem. Here are those settings


<behavior name="XAPTICLarge">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>



<binding name="LargeBinding"

How to go around the file size issue when uploading large files?



In my application the user uploads three files ( Resume, Cover Letter, Selection Creteria).

I want users not to upload more then 4 MB files, so In my web.confing file I have allowed max of 5 MB. <httpRuntime maxRequestLength="5000"/>. I did this so that I can validate the file and give user a message that they are trying to upload more then 4 MB file.

It all works fine if the user is only uploading resume. But if the user uploads all three files of size 4MB then my validation does not work and it goes to connection time out.

How can i handle the validation to check the file size of all 3 files?


AsyncFileUpload is not uploading the file



I have added AsyncFileUpload to creata user wizard control. When I tried to upload the file this control seemed to work fine and show confirmation at the end. But when I checked the website no file has been uploaded at all.

Here is the code, please let me know why its not uploading the files/images

<asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"  
 FinishDestinationPageUrl="~/MyPage.aspx"                                     LoginCreatedUser="False" CreateUserButtonText="Add" oncreateduser="CreateUserWizard1_CreatedUser1" 
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" >
<asp:WizardStep ID="WizardStep1" runat="server" Title="Set preferences">
<asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" ThrobberID="spanUploading" OnClientUploadError="

Uploading to SQL Server using AJAX muiltiple file uploader and dynamic SQL Server Tables


I am getting an error on the following code when trying to pload files directly to a database.  

 Incorrect syntax near ','.

 Incorrect syntax near 'image'.


    Private Sub Uploader_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)

        Dim data() As Byte = New Byte((args.FileSize) - 1) {}

        Dim stream As Stream = args.OpenStream

        stream.Read(data, 0, data.Length)

    End Sub


Private Sub ButtonTellme_Click(ByVal sender As Object, ByVal e As EventArgs)


        Dim objConn As New SqlConnection("Data Source=mrpoteat.db.2798093.hostedresource.com; Initial Catalog=mrpoteat; User ID=mrpoteat; Password=Colgate23;")


        Dim strCommandText As String = ""

        For index = 1 To Attachments1.Items.Count Step 1

            strCommandText += "pic" + index.ToString() + Space(5)

Access to path xxx denied when uploading a file using c#

Hi I have a file upload app written in c#. The app runs on IIS on a Windows 2003 Server OS. I want the app to upload the file onto the server (The app and the server are on the same machine). This code has been working fine for a long time running on Windows Server 2000, and Windows XP Professional. Now when I moved onto Windows Server 2003, it stopped working. I have given ASPNET account full access to the folder on the server, and it still gives this error. Is this a bug in 2003, and can anybody assist me? Thanks Shane

Upload large file via webservice problem in vb.net 1.1

Hi All, I am uploading large file via webservice using below my code in vb.net 1.1. Problem is vb.net 1.1 don't know Using Object loop. I would like to know any other loop similar Using loop to replace in vb.net 1.1Public Function UploadLargeFile(ByVal FileName As String, ByVal buffer As Byte(), ByVal Offset As Long) As Boolean Dim retVal As Boolean = False Try Dim FilePath As String = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory.ToString() & "\fpath\", FileName) If Offset = 0 Then File.Create(FilePath).Close() End If Using fs As New FileStream(FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.Read) fs.Seek(Offset, SeekOrigin.Begin) fs.Write(buffer, 0, buffer.Length) End Using retVal = True Catch ex As Exception Throw ex End Try Return retVal End Function  

Uploading a file to a document library produces access denied error, but only on first try.

Hi I have a task which uses a custom form which is part of a custom workflow.  The form incorporates an asp fileUpload control to allow a user to browse for a local file which they can then select and it will be upload a file to a folder in a document library.  The first time this action is performed the folder in the document library will not exist so the code creates a folder and then uploads the file to it. The problem I have is, the first time users try and upload a file the directory is created in the document library as expected, but then the user gets redirected to the standard SharePoint Access Denied page.  If the user goes back to the task list, then loads the task web page again, selects the same file and hits upload, then the file is uploaded fine. All subsequent file uploads work fine after that for all users. Users have Contribute permissions on the document library. The code to do the upload is as follows.  The task has a "CR Number" associated with it, which the directory in the doc library should be called.  It uploads the file to a stream.  Then gets the url of the web and works out the file url and uploads it.  The creation and checking of the folder in the doc library happens in the getDirUrl method. /// <summary> /// Processes an uploaded file. /// </summary> /// <param name="

What is the best Hosting model when Uploading Large Files via WCF?

I am building a WCF service where besides regular CRUD operations, it porovides methods to upload large (upto 15MB each) files. The service will serve a number of "clients" that will send data to our back-end. Now, while some of the clients are ok with sending one file at time, others would like to be sending these files in batches (i.e. several files at a time).... My questions: What is the best option for hosting this service considering the environment (see below)?  Will IIS be able to support it or will it time out? I know you can increase timeout limit in config file but how will it handle a batch of large files at a time? Is windows service a better option here? What are the dis/advantages of IIS vs Win Srvc in this scenario?  Current Environment: Win 2003 Server w/IIS 6.0 and WCF (.NET 3.5) Thanks in advance!

Problem with uploading a zip file containing xls with macros

I am getting the following error when I try to upload a zip file containing xls file with macros. The zip file size is 4 mb. However, we have SP 2010 environment (ready to be deployed in couple of months) and it works there. So, it is not to do with the file. I am not sure if SP 2007 has any limitations/restrictions with .xlsm files. How do I fix this issue ? "GILA_Reports_File_byGTStar_9_2010.zip" contains the following virus: "Large uncompressed size; Tagged ID: C57E7332_69BC_484A_B087_DB04D574CDC4" . This file cannot be saved to the document library. If you want to save this file to the document library, clean the file using alternative virus scanning software and try saving it again.

user.identity.name="0" when uploading file using ajaxToolkit:AsyncFileUpload

hi, i am using AsyncFileupload to upload user picture. after the picture is uploaded and saved i opened another page and i noticed that the user.identity.name is lost. any idea 

How to read and analyze a very large log file with high efficiency and performance?

It is a very large .txt file (more than 3M), and produced everyday, the content is user's system log like below: 2007-11-01 18:20:42,983 [4520] INFO GetXXX() SERVICE START2007-11-01 18:21:42,983 [4520] WARING USER ACCESS DENIED2007-11-01 18:22:42,983 [4520] ERROR INPUT PARAMETER IS NULL CAN NOT CONVERT TO INT322007-11-01 18:23:59,968 [4520] INFO USER LOGOUT   Any idea? Thanks.

Uploading doc file into SharePoint Document library Programatically.

Hi all, I want to upload the doc file into SharePoint document library using the FileUpload control. For that I am created a new document library in my SharePoint site. But I am not getting the path of Document library where I want to upload the file. Waiting for your valuable response. Regards,-Kaustubh

Error In Firefox When uploading a file

The page isn't redirecting properlyFirefox has detected that the server is redirecting the request for this address in a way that will never complete.    *   This problem can sometimes be caused by disabling or refusing to accept          cookies.

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

uploading a file with wcf works fine with local drive, but only 4096 kb uploaded when I use unc stor

Hello I'm writing a wcf service for uploading files to a server. It works fine when I try to upload the file to the servers local c:/ drive, but if I use a UNC path only 4096 kb is stored. It actually looks like part of the file is lost while storing it with writeStream.Write(buffer, 0, bytesRead);, because I wrote the bytesread to an sql table and the number of elements are always the same no matter how many times I upload the file, but the stored file is always different sizes, ranging from 1996 kb to 4092 kb.   I'm using IIS 7.5 on a windows 7 enterprise machine. My IIS is using a administrator account for the application pool, so it should not be a problem with permissions.   My wcf method uses Stream to upload the file in chunks    public void UploadFile(RemoteFileInfo request)         { //some methods to set the filepath                                   int chunkSize = 4096;                                 byte[] buffer = new byte[chunkSize];                                 Stream writeStream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write);  &

file creation date after uploading document to document library


Hi i am writing a event receiver to get the file creation date after the document is uploaded to the document library.

When a document library is uploaded to a document library the created date is overwriten by the uploaded date.


issues 1) i am not getting the folder path to get the filecreation date for system.io.file.getcreation() method

  public override void ItemAdded(SPItemEventProperties properties)

        properties.ListItem["Created"] =CreationTime(date);
        properties.ListItem["Title"] = itemurl;
      catch (Exception ex)


public CreationTime(SPItemEventProperties properties) {

 using (SPSite site = new SPSite("http://test"))

        SPWeb oWebsiteSrc = site.OpenWeb();

        SPFileCollection fileCollection = oWebsiteSrc.Files ;
        //get the filelocation of the current document library
        string filepath = fileCollection.Web.Lists["test"].Folders.ToString();
        SPList oList = site.AllWebs["jtest"].Lists["test"];
        SPFolder folder=oWebsiteSrc.Files.Folder;

        SPListItem fileitems =oWebsiteSrc.Lists["test"].Items[0] ;
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