3

I'm trying to upload a large file to a document library, but it fails after just a few seconds. The upload single document fails silently, upload multiple just shows a failed message. I've turned up the file size limit on the web application to 500MB, and the IIS request length to the same (from this blog), and increased the IIS timeout for good measure. Are there any other size caps that I've missed?

Update I've tried a few files of various sizes, anything 50MB or over fails, so I assume something somewhere is still set to the webapp default.

Update 2 Just tried uploading using the following powershell:

$web = Get-SPWeb http://{site address}
$folder = $web.GetFolder("Site Documents")
$file = Get-Item "C:\mydoc.txt" // ~ 150MB
$folder.Files.Add("SiteDocuments/mydoc.txt", $file.OpenRead(), $false)

and get this exception:

Exception calling "Add" with "3" argument(s): "<nativehr>0x80070003</nativehr><nativestack></nativestack>There is no file with URL 'http://{site address}/SiteDocuments/mydoc.txt' in this Web."

which strikes me as odd as of course the file wouldn't exist until it's been uploaded? N.B. while the document library has the name Site Documents, it has the URL SiteDocuments. Not sure why...

  • Have you got access to the SharePoint ULS logs? – Simon Doy Aug 5 '13 at 12:05
  • I do. I've not seen anything particularly unusual, but I'm not sure what I should be looking for in this case. I have noticed several HEAD requests being made on the files I'm trying to upload. – Mourndark Aug 5 '13 at 12:30
  • I would suggest looking for the word exception. What file type are these files? They aren't blocked are they? – Simon Doy Aug 5 '13 at 13:46
  • They are zip files. I've been testing with txts for the moment as they are easy to generate with a fixed size. – Mourndark Aug 5 '13 at 16:40
  • Are you getting the exception (powershell) instantly or there is a delay ? What is you current IIS timeout length ? – JayHell Aug 5 '13 at 18:08
2

based on what you have entered it makes me wonder that you have done the correct steps in incrementing the max file size but have you done it in the web application web.config?

ammend the following line 'httpRuntime' to:

<httpRuntime maxRequestLength="51200" /> with <httpRuntime executionTimeout="999999" maxRequestLength="51200" />

add the above code and do an iisreset! now try a file size of 49996KB as you did before and it should work ;) , its timing out because you havent set it in the web.config :)

for further reading and methods:

Issues Uploading Large Files To SharePoint

EDIT

can you try this powershell code instead! the error you got last time was due to the web object being empty as its not set for some reason? i would think it would fail on $folder.Files.Add , this means you are adding the file to a folder! which is not what you want! you just want to upload a file to the document library right?

$spFolder = $spWeb.GetFolder("Site Documents") 
$spFileCollection = $spFolder.Files 
$file = Get-ChildItem C:\Documents\mydoc.txt 
$spFileCollection.Add("Site Documents/mydoc.txt",$file.OpenRead(),$false) 
Get-ChildItem C:\Documents -filter “*.docx” | ForEach { $spFileCollection.Add(“Site Documents/$($_.Name)”,$_.OpenRead(),$true)} 

Use PowerShell Cmdlets to Manage SharePoint Document Libraries

now try the above code! its assuming that you have a file called mydoc.txt within a folder on C drive called Documents, the full path is C:\Documents\mydoc.txt .

the above code should work if the settings are correct!! if it fails than it seems to be somthing other than the settings as all are correct!

just to clarifiy you have set the max value to this? in web app general settings within central admin! please note 250mb is max!

enter image description here

I need to know the exact error that your getting! The error in your update that your showing when you run the powershell script is due to the code not reaching the spweb correctly and the PS code that i posted is the correct way!

please look at your event viewer log under application to see any errors! what errors do you see exactly? by erroring silently what do you mean by that? usually if you dont get an error on event viewer but you do see one on the UI (browser) it will state a number, that number you can use within the uls to find the corresponding error within the list!

  • I've upped executionTimeout and maxRequestLength, but still no luck I'm afraid. This is a real puzzle. – Mourndark Aug 22 '13 at 16:27
  • just ammended my answer – Ali Jafer Aug 27 '13 at 8:55
0

Why don't you try with SharePoint RBS? The following links might help you;

  1. http://blogs.technet.com/b/stefan_gossner/archive/2011/06/23/sharepoint-2010-rbs-documentation-has-been-updated.aspx

  2. http://technet.microsoft.com/en-us/library/cc262787(v=office.14).aspx

  3. http://www.thesharepointblog.net/Lists/Posts/Post.aspx?ID=36

  4. http://www.olavaukan.com/2010/03/error-when-uploading-large-files-to-sharepoint-running-on-windows-server-2008/

Or, do the following in the Central Administration:

  1. http://www.anmolrehan-sharepointconsultant.com/2012/01/sharepoint-2010-document-library-upload.html
  • 3
    Please do not only provide links as an answer, better to extract the useful information and just link to pages as a source :) Also, multiple question marks and a lack of capital letters make me a bit sad;) – Robert Lindgren Aug 5 '13 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.