Rectangle 27 1

Putting that lot together is an exercise for the reader ;)

The default maximum file size for a document library is 50MB (2007/2010) but this can be increased up to 2GB (see MSDN) - however you are risking performance problems with a large volume of very large files.

Thanks for the links Ryan. Would it be a good approach to embed lage file data inside SOAP body and then upload it to sharepoint??

If its very large that could be a problem (and exactly how large depends upon many variables) but its exactly the same when uploading using the browser & not sure you have a choice of any other methods.

300 MB is very big for a doc library. See Edit

Upload files from an iPad appliacation to SharePoint using objective C...

ipad sharepoint file-upload base64 large-files
Rectangle 27 1

When you run on the server your code runs under a different account (apppool identity) which does not have the permission to read C drive.

I dont know why would you want to read and upload a file from the same server, looks like you are simply testing Sharepoint Object Model then it is ok

If you are expecting some other app or service to keep an updated file for Sharepoint , it should be moved to the web directory i.e \wwwroot\wss\VirtualDirectories\80 and then use your code to read and update your doc lib (myLibrary) as you are doing.

Upload a file to a document library in SharePoint 2010 programmaticall...

sharepoint sharepoint-2010
Rectangle 27 1

If I understood your requirements properly, you need to upload file into SharePoint On-Premise, right? There are several options on how to accomplish it.

At least the following components could be utilized for that purpose:

The example demonstrates how to upload file using WebClient.UploadFile Method:

public static void UploadFile(Uri targeUri, ICredentials credentials, string fileName)
{
     using (var client = new WebClient())
     {
         client.Credentials = credentials;
         //client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
         var targetFileUri = targeUri + "/" + Path.GetFileName(fileName);
         client.UploadFile(targetFileUri, "PUT", fileName);      
     }
 }
var filePath = @"C:\Documents\SharePoint User Guide.docx";
 var credentials = new NetworkCredential(userName, password, domain);
 UploadFile(new Uri("https://contoso.sharepoint.com/documents"),credentials, filePath);
using (var site = new SPSite(url))
{
    using (var web = site.OpenWeb())
    {
       var list = web.Lists.TryGetList(listTitle);
       var targetFolder =  list.RootFolder;
       var fileContent = System.IO.File.ReadAllBytes(fileName);
       var fileUrl = Path.GetFileName(fileName);
       targetFolder.Files.Add(fileUrl, fileContent);
    }
}

How to upload a file to a SharePoint site using File.SaveBinaryDirect Method

using (var ctx = new ClientContext(url))
{
     ctx.Credentials = new NetworkCredential(userName, password, domain);
     using (var fs = new FileStream(fileName, FileMode.Open))
     {
         var fi = new FileInfo(fileName);
         var list = ctx.Web.Lists.GetByTitle(listTitle);
         ctx.Load(list.RootFolder);
         ctx.ExecuteQuery();
         var fileUrl = String.Format("{0}/{1}", list.RootFolder.ServerRelativeUrl, fi.Name);

         Microsoft.SharePoint.Client.File.SaveBinaryDirect(ctx, fileUrl, fs, true);
     }
}
var webUri = new Uri("http://contoso.sharepoint.com");
 string sourceUrl = @"C:\Documents\SharePoint User Guide.docx";
 string destinationUrl = webUri + "/documents/SharePoint User Guide 2013.docx";
 var fieldInfo = new FieldInformation();
 FieldInformation[] fieldInfos = { fieldInfo };
 CopyResult[] result;
 using (var proxyCopy = new Copy())
 {
      proxyCopy.Url = webUri + "/_vti_bin/Copy.asmx";
      proxyCopy.Credentials= new NetworkCredential(userName, password, domain);

      var fileContent = System.IO.File.ReadAllBytes(sourceUrl);

      proxyCopy.CopyIntoItems(sourceUrl, new[] { destinationUrl }, fieldInfos, fileContent, out result);
  }

c# - How to upload a file to a document library in sharepoint? - Stack...

c# sharepoint sharepoint-2010
Rectangle 27 0

I have use the Following code its work perfectly for me:
    //Copy WebService Settings 
        string webUrl           = "http://sharepointportal.ABC.com/";
        WSCopy.Copy copyService = new WSCopy.Copy();
        copyService.Url         = webUrl + "/_vti_bin/copy.asmx";
        copyService.Credentials = new NetworkCredential("username", "****", "Domain");

        //Declare and initiates the Copy WebService members for uploading 

        string sourceUrl        = "C:\\Work\\Ticket.Doc";   

        //Change file name if not exist then create new one     
        string[] destinationUrl    = { "http://sharepointportal.ABC.com/personal/username/Document Upload/Testing Document/newUpload.Doc" };

        WSCopy.CopyResult cResult1 = new WSCopy.CopyResult();

        WSCopy.CopyResult cResult2 = new WSCopy.CopyResult();

        WSCopy.CopyResult[] cResultArray = { cResult1, cResult2 };

        WSCopy.FieldInformation fFiledInfo = new WSCopy.FieldInformation();

        fFiledInfo.DisplayName = "Description";

        fFiledInfo.Type        = WSCopy.FieldType.Text;

        fFiledInfo.Value       = "Ticket";

        WSCopy.FieldInformation[] fFiledInfoArray = { fFiledInfo }; 

        FileStream strm = new FileStream(sourceUrl, FileMode.Open, FileAccess.Read); 

        byte[] fileContents = new Byte[strm.Length]; 

        byte[] r = new Byte[strm.Length];

        int ia = strm.Read(fileContents, 0, Convert.ToInt32(strm.Length));
        strm.Close();
        //Copy the document from Local to SharePoint 

        uint copyresult = copyService.CopyIntoItems(sourceUrl, destinationUrl, fFiledInfoArray, fileContents, out cResultArray); 

        MessageBox.Show("Suceess");  

      }
     catch (Exception ex)    
     { 
        MessageBox.Show(ex.Message);

     }

Hi Ravi, can you post your SOAP request. I believe that there is something wrong with my SOAP message, maybe I can identify it after comparing it with your.

Nevermind, there is a bug in my code, I'm passing extra string when initializing the Copy service. Thanks Ravi.

java - Gettting 400 Bad Request while uploading file to SharePoint 201...

java web-services sharepoint
Rectangle 27 0

First off, your code probably crashed because it ran out of memory. I would do a loop where I read chunks that I converted and then pushed to a open socket. This probably means that you need to go to a lower level than NSURLConnection, I have tried to search for NSURLConnection and chunked upload without much success.

Some seem to suggest using ASIHttp, but looking at the homepage it seems abandoned by the developer, so I can't recommend that.

AFNetworking looks really good, it has blocks support and I can see in the example on the first page how it could be used for you. Look at the streaming request example. Basically create a NSInputStream that you push chunked data to and use it in a AFHTTPURLConnectionOperation.

Base64 encode very large files in objective C to upload file in sharep...

objective-c sharepoint file-upload base64 large-files
Rectangle 27 0

Putting that lot together is an exercise for the reader ;)

The default maximum file size for a document library is 50MB (2007/2010) but this can be increased up to 2GB (see MSDN) - however you are risking performance problems with a large volume of very large files.

Thanks for the links Ryan. Would it be a good approach to embed lage file data inside SOAP body and then upload it to sharepoint??

If its very large that could be a problem (and exactly how large depends upon many variables) but its exactly the same when uploading using the browser & not sure you have a choice of any other methods.

300 MB is very big for a doc library. See Edit

Upload files from an iPad appliacation to SharePoint using objective C...

ipad sharepoint file-upload base64 large-files