Error when downloading large SharePoint document using REST API
Hello,
The following code works fine for small files, but I got "SCRIPT14: Not enough storage is available to complete this operation." error when downloading files over 100M.
Is it possible to write the data directly to a local storage (IndexedDB for example) instead of keeping it in memory?
var getFileEndpoint = String.format(
"{0}/_api/SP.AppContextSite(@target)/web/getfilebyserverrelativeurl('{1}')/$value?@target='{2}'",
_SPAppWebUrl, _DocumentUrl, _SPHostUrl);
var executor = new SP.RequestExecutor(_SPAppWebUrl);
var info = {
url: getFileEndpoint,
method: "GET",
//binaryStringResponseBody: true,
success: function (data) {
//Save data to IndexedDB
error: function (err) {
//Error handling
executor.executeAsync(info);
Since my page is located in a SharePoint Hosted App, I can't use XMLHttpRequest directly to access the document in the host site. Seems like the MS cross-domain library is the only choice to me.
Thanks,
Matt.
Matt
Hi,
Per my understanding, you might want to download the content of files into database in SharePoint Hosted App.
In SharePoint Hosted App, as we can only use JavaScript which is supposed to be executed in browser, the content retrieved will be stored in memory then to the local hard drive.
As a workaround, I suggest you develop a Provider Hosted App and do the same job there instead. In Provider Hosted App, we can use C# to handle the file downloading which should
be more appropriate in your scenario.
About
how to download file using SharePoint Client Object Model:
http://www.lucacostante.com/item/15-download-and-upload-files-via-sharepoint-client-object-model.html
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]
Similar Messages
-
Shut down and restarted computer, "browser error" still pops up when trying to access documents using Google doc's.
Holding shift key and clicking refresh does not clear window.
What else can be done to clear the window and gain access to my documents?Hi,
Found a note explaining the significance of these errors.
It says:
"NZE-28862: SSL connection failed
Cause: This error occurred because the peer closed the connection.
Action: Enable Oracle Net tracing on both sides and examine the trace output. Contact Oracle Customer support with the trace output."
For further details you may refer the Note: 244527.1 - Explanation of "SSL call to NZ function nzos_Handshake failed" error codes
Thanks & Regards,
Sindhiya V. -
Add user to sharepoint group using REST API
I am trying to add a user to sharepoint group with following code
serviceUrl= Appweb + "/_api/SP.AppContextSite(@target)/web/sitegroups("+GroupId+")/users?@target='host web'";
$.ajax({
url: serviceUrl,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|'+email }",
headers: {"accept":"application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest":$("#__REQUESTDIGEST").val()
async: false,
success: function (data) {
alert('success');
error: function (data) {
alert('fail');
The request goes to error function. Response of the request is Microsoft.SharePoint.Client.InvalidClientQueryException and message is A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was
expected
I tried the sample from following link but fail it
https://msdn.microsoft.com/en-us/library/office/dn531432.aspxHi,
Per my understanding, you might want to add an user to a SharePoint group in host web from a SharePoint Hosted App using REST API.
Here is a working demo for your reference:
var hostweburl;
var appweburl;
$(document).ready(function () {
//Get the URI decoded URLs.
hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
// Resources are in URLs in the form:
// web_url/_layouts/15/resource
var scriptbase = hostweburl + "/_layouts/15/";
// SP.RequestExecutor.js to make cross-domain requests
$.getScript(scriptbase + "SP.RequestExecutor.js", loadPage);
// Utilities
// Retrieve a query string value.
// For production purposes you may want to use a library to handle the query string.
function getQueryStringParameter(paramToRetrieve)
var params = document.URL.split("?")[1].split("&");
for (var i = 0; i < params.length; i = i + 1)
var singleParam = params[i].split("=");
if (singleParam[0] == paramToRetrieve) return singleParam[1];
function addUsersInGroup() {
var executor;
// Initialize the RequestExecutor with the app web URL.
executor = new SP.RequestExecutor(appweburl);
executor.executeAsync({
url: appweburl + "/_api/SP.AppContextSite(@target)/web/sitegroups(8)/users?@target='" + hostweburl + "'",
method: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|[email protected]'}",
headers: {
"Accept": "application/json; odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest":$("#__REQUESTDIGEST").val()
success: addUsersInGroupSuccessHandler,
error: addUsersInGroupErrorHandler
function addUsersInGroupSuccessHandler(data)
console.log(data);
var jsonObject = JSON.parse(data.body);
console.log(jsonObject);
function addUsersInGroupErrorHandler(data)
console.log(data);
var jsonObject = JSON.parse(data.body);
console.log(jsonObject);
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]. -
Error on creating Purchase order document using DI API
Dear all,
I am getting an error "<b>Server threw an exception</b>" at the time of initializing object of Purchse order document. code is
vDrafts = GOD_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
I am using SBO 2005B SP 0 PL-20.
Reply as soon as possible.
Regards,
Manish JhaHi Manish,
I am not sure if I am right, but I remember something about a bug in SBO SDK that gave an error when trying create draft object. Not sure on which patch this was though and am not sure if this is your problem too. Maybe someone else can remember what patch it was on?
Hope it helps,
Adele -
Error when downloading large audio files
I purchased two audio files (.m4a) and got emailed the download links. One was 3.7MB and when I clicked the download link in the email on my iphone 4 it streamed. The other file was 76.8MB and when I clicked the link in the email on my iphone 4 I get a 'This operation cannot be completed' message.
Both files could be downloaded fine on my computer.
Does anyone know why this would be the case? And what I can do about it?Hi,
Per my understanding, you might want to download the content of files into database in SharePoint Hosted App.
In SharePoint Hosted App, as we can only use JavaScript which is supposed to be executed in browser, the content retrieved will be stored in memory then to the local hard drive.
As a workaround, I suggest you develop a Provider Hosted App and do the same job there instead. In Provider Hosted App, we can use C# to handle the file downloading which should
be more appropriate in your scenario.
About
how to download file using SharePoint Client Object Model:
http://www.lucacostante.com/item/15-download-and-upload-files-via-sharepoint-client-object-model.html
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
When I acess this site I can not download .dat files get a corrupted data error
<i>Moderator Comment<br>
(Duplicate thread closed. Continue at [/questions/1000178]) -m) </i> -
ELQ-00107 errors when exporting activity data with Bulk REST API (2.0)
I am following the flow described in Bulk API v2.0 Documentation
I POST to https://secure.eloqua.com/api/bulk/2.0/activities/exports and get back (note: I'm working in python so this is all deserialized json)
{u'createdAt': u'2014-08-14T07:05:17.6413979Z',
u'createdBy': u'P D',
u'fields': {u'ActivityDate': u'{{Activity.CreatedAt}}',
u'ActivityId': u'{{Activity.Id}}'},
u'filter': u"('{{Activity.CreatedAt}}' > '2014-07-31T23:43:02.080971Z' AND '{{Activity.Type}}' = 'EmailOpen')",
u'name': u'blarg3',
u'updatedAt': u'2014-08-14T07:05:17.6413979Z',
u'updatedBy': u'P D',
u'uri': u'/activities/exports/275'}
Next I POST to /syncs and get back
{u'createdAt': u'2014-08-14T07:05:31.6571126Z',
u'createdBy': u'P D',
u'status': u'pending',
u'syncedInstanceUri': u'/activities/exports/275',
u'uri': u'/syncs/17790'}
Now (unfortunately) I GET /syncs/17790 and /syncs/17790/logs
{u'createdAt': u'2014-08-14T07:05:31.9330000Z',
u'createdBy': u'P D',
u'status': u'error',
u'syncStartedAt': u'2014-08-14T07:05:32.6570000Z',
u'syncedInstanceUri': u'/activities/exports/275',
u'uri': u'/syncs/17790'}
{u'count': 2,
u'hasMore': False,
u'items': [{u'count': 0,
u'createdAt': u'2014-08-14T07:05:33.3770000Z',
u'message': u'There was an error processing the export.',
u'severity': u'error',
u'statusCode': u'ELQ-00107',
u'syncUri': u'/syncs/17790'},
{u'count': 0,
u'createdAt': u'2014-08-14T07:05:33.3930000Z',
u'message': u'Sync processed for sync 17790, resulting in Error status.',
u'severity': u'information',
u'statusCode': u'ELQ-00101',
u'syncUri': u'/syncs/17790'}],
u'limit': 1000,
u'offset': 0,
u'totalResults': 2}
All I can find for ELQ-00107 is "ELQ-00107: There was an error processing the {type}."
Any thoughts on what I may have done wrong? Pointers on how I can debug further?
Thanks!
Joel Rothman-Oracle allison.moore 1086203 Ryan Wheler-OracleHi 1086203
I am facing the same issue. I am trying my request from SOAPUI
As suggested by you i am not using any sub zero second precision
Response from export definition:
<Response xmlns="https://secure.eloqua.com/api/bulk/2.0/activities/exports">
<createdAt>2014-08-28T22:00:40.5537126Z</createdAt>
<createdBy>Eloqua</createdBy>
<fields>
<ActivityDate>{{Activity.CreatedAt}}</ActivityDate>
<ActivityId>{{Activity.Id}}</ActivityId>
<ActivityType>{{Activity.Type}}</ActivityType>
<AssetId>{{Activity.Asset.Id}}</AssetId>
<AssetName>{{Activity.Asset.Name}}</AssetName>
<AssetType>{{Activity.Asset.Type}}</AssetType>
<ContactId>{{Activity.Contact.Id}}</ContactId>
<Id>{{Activity.Id}}</Id>
<RawData>{{Activity.Field(RawData)}}</RawData>
<VisitorId>{{Activity.Visitor.Id}}</VisitorId>
</fields>
<filter>'{{Activity.Type}}'='FormSubmit' And '{{Activity.CreatedAt}}'>'2014-08-26T00:00:00'</filter>
<name>Example Activity Export</name>
<updatedAt>2014-08-28T22:00:40.5537126Z</updatedAt>
<updatedBy>Eloqua.APIUser1</updatedBy>
<uri>/activities/exports/36</uri>
</Response>
Response Sync the data for export
<Response xmlns="https://secure.eloqua.com/api/bulk/2.0/activities/exports">
<createdAt>2014-08-28T22:03:05.0953641Z</createdAt>
<createdBy>Eloqua</createdBy>
<status>pending</status>
<syncedInstanceUri>/activities/exports/36</syncedInstanceUri>
<uri>/syncs/16</uri>
</Response>
GET https://secure.eloqua.com/api/bulk/2.0/syncs/16 to check the status of sync
<Response xmlns="https://secure.eloqua.com/api/bulk/2.0/activities/exports">
<createdAt>2014-08-28T22:03:04.8630000Z</createdAt>
<createdBy>Eloqua</createdBy>
<status>error</status>
<syncStartedAt>2014-08-28T22:03:14.4970000Z</syncStartedAt>
<syncedInstanceUri>/activities/exports/36</syncedInstanceUri>
<uri>/syncs/16</uri>
</Response>
Logs.
<Response xmlns="https://secure.eloqua.com/api/bulk/2.0/activities/exports">
<count>2</count>
<hasMore>false</hasMore>
<items>
<e>
<count>0</count>
<createdAt>2014-08-28T22:03:16.4330000Z</createdAt>
<message>There was an error processing the export.</message>
<severity>error</severity>
<statusCode>ELQ-00107</statusCode>
<syncUri>/syncs/16</syncUri>
</e>
<e>
<count>0</count>
<createdAt>2014-08-28T22:03:16.4670000Z</createdAt>
<message>Sync processed for sync 16, resulting in Error status.</message>
<severity>information</severity>
<statusCode>ELQ-00101</statusCode>
<syncUri>/syncs/16</syncUri>
</e>
</items>
<limit>1000</limit>
<offset>0</offset>
<totalResults>2</totalResults>
</Response>
Kindly help
Thanks
Vinay -
How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?
any idea?Hi,
From your description, my understanding is that you want to get user profile properties in provider-hosted app in SharePoint online using REST API.
Here is sample code for getting user profile properties:
http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
Here is a blog below about accessing data from the provider-host apps:
http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Sharepoint-Hosted App giving FORBIDDEN error when i use REST Api
Hi,
I have created a sharepoint hosted app which will create Team site on button click.
I used REST Api and NAPA Tool to develop this app.
Napa tool gives to things ClientWebpart.aspx and Default.aspx.
When i run my Default.aspx code is working fine but ClientWebpart.aspx is giving FORBIDDEN error when i am trying to create site.
Below is the code which i used to create site
code:
var hostweburl;
var appweburl;
$(document).ready(function () {
hostweburl= decodeURIComponent(getQueryStringParameter("SPHostUrl"));
appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
function createSPWeb() {
$.ajax(
url: appweburl +
"/_api/SP.AppContextSite(@target)/web/webinfos/add?@target='" +
hostweburl + "'",
type: "POST",
data: JSON.stringify(
'parameters':
'__metadata': { 'type': 'SP.WebInfoCreationInformation' },
'Url': 'RestSubWeb',
'Title': 'RestSubWeb',
'Description': 'REST created web',
'Language': 1033,
'WebTemplate': 'sts#0',
'UseUniquePermissions': false
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
success: successHandler,
error: errorHandler
NOTE:This is on sharepoint online.
Please help
Regards,
sudeepSo in the app you are testing, are you using the FQDN or the NetBIOS name? Bad practice but could you test with both (hard code the absolute URL for testing purposes) then retest your app?
If you are making a web part based on the new app model this will be an "app part" and probably have the same issues you are experiencing. If this is for something internal rather than a product you are developing to resell then the script editor /
content editor web part approach could work for you.
Paul
Paul Mather | Twitter |
http://pwmather.wordpress.com | CPS -
401 Unauthorized Error When calling a SharePoint REST web service from SharePoint 2013 Workflow
We have our Workflow Manger installed on the same server as our SharePoint 2013 WFE development environment. When creating a SharePoint 2013 Workflow all Calls to a SharePoint 2013 REST web service results in a 401 Unauthorized error.
As an example I created a simple workflow that should return a JSON result. The REST Url returns the results in the browser without error.
Set Variable:webServiceUrl to https://<hostnamedsitecollection>/_vti_bin/client.svc/web/lists/getbytitle('ISR%20Approvers')/Items?$select=Title&$filter=Title%20eq%20%27General%27
then Build{...} Dictionary (Output to Variable:requestHeaders)
then Call [%Variable:webServiceUrl%] HTTP web service with request (ResponseContent to Variable:responseContent |ResponseHeaders to responseHeaders | ResponseStatusCode to Variable:responseCode)
The RequestHeader is set to the requestHeaders variable though the web service call properties
then Log Variable:responseCode to the workflow history list
After manually running the workflow in SharePoint on a list item in the ISR Approvers list it Logs "Unauthorized" in the Workflow History Log. It does this with every SharePoint REST web service call that I have tried through the workflow.
It doesn't have anything to do with the Workflow Manger being installed on the same machine as the SharePoint WFE does it?
Thank You for any insightHi,
According to your post, my understanding is that you had 401 Unauthorized Error when calling a SharePoint REST web service from SharePoint 2013 Workflow.
Please make sure you use the ‘Call HTTP Web Service’ correctly.
You can enter the URL into the brower to check whether it is correctly.
You need to
create the Request header requestHeaders
using a Dictionary:
Accept : application/json;odata=verbose
Content-Type : application/json;odata=verbose
To associate the
requestHeaders variable, select the Call action
property, set the RequestHeaders property to
requestHeaders.
Please refer to the following articles:
Working with Web Services in SharePoint 2013 Workflows using SharePoint Designer 2013
Calling the SharePoint 2013 Rest API from a SharePoint Designer
Workflow
In addtion, you need to make sure you install the workflow manager correctly.
More information:
Install and configure workflow for SharePoint Server 2013
Known Issues in Workflow Manager 1.0
Troubleshooting Workflow Manager 1.0 Management and Execution
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Document Set Creation in document library using REST API in Sharepoint 2013
Hi,
I want to create the document set using REST API call. Currently i am able to create the folder and able to upload the files using REST API's in the document library. Is there any way we can pass the contentype name or Id and create the document set using
REST API call. We need to create the document set along with metadata and upload the files inside the document set.
I need to create the document set along with meta data column values using REST API. Please let me know how we can achieve this through REST API.
Thank you,
MylsamyHi,
According to your post, my understanding is that you wanted to create document set along with managed metadata fields.
The REST API does not currently support working with Managed Metadata or Taxonomy fields.
As a workaround, we can use the JavaScript Client Object Model.
Create document set using JavaScript Client Object Model.
http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
http://social.technet.microsoft.com/Forums/sharepoint/en-US/aacd96dc-0fb2-4f0d-ab4c-f94ce819e3ed/create-document-sets-with-javascript-com-sharepoint-2010
Set managed metadata field with JavaScript Client Object Model.
http://sharepoint.stackexchange.com/questions/95933/add-list-item-with-managed-metadata-field-through-jsom
http://sharepointfieldnotes.blogspot.com/2013/06/sharepoint-2013-code-tips-setting.html
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jason Guo
TechNet Community Support -
I get this error when downloading key not valid for use in specified state what do i do
i get this error when downloading key not valid for use in specified state what do i do
What is your operating system? What are you trying to download?
-
recd following error when attempt to open ebook using ADE 4.0 : "Unable to Download. Error getting License. License Server Communication Problem: E_LIC_LICENSE_SIGN_ERROR" iMac 10.8.5 Chrome Version 37.0.2062.124
chat with customer service at book company i purchased file:
"Me: I installed the proper adobe software, adobe digital editions 3.0 (now have updated to 4.0) on my mac running os 10.85 however I am getting the following error code when i try to open the file:
"Error getting License. License Server Communication Problem:
E_LIC_LICENSE_SIGN_ERROR"
Charles P.: Okay, what you need to do unfortunately, is contact Adobe at http://www.adobe.com and they will need to get your license issue resolved.
Charles P.: Is there anything else I can assist you with today?
Me: title of error is Unable to Download
Me: i dont see how that would be an adobe problem?
Charles P.: I understand, but it appears that the reason for the download issue is because of the license error the license is related to the Adobe Digital editions software. I understand how this could be confusing but it's due to the authorization of the ADE software. Adobe would need to correct your account issue with the license
Me: ok but i thought this was a free license from adobe??!! this is just a digital editions reader, right??
Charles P.: That is correct it is a free license but your account has to be associated with one license and yes the Digital edition is a ebook reader that our ebooks use for you to viewWell, just for the halibut I tried opening the book again today and , GLORY BE!, it worked.
Guess it may have taken overnight for Adobe to OK my license to their free ADE software. Also works now using Bluefire app as the reader on my android phone, although it was a pain
to get the book file in the right file folder for bluefire to see it.
I hope that time also heels the issue with all other Error Getting License users.
panman -
Using REST API to promote Document Properties into SharePoint document library
Hi,
Is it possible to extract Document properties of a file and update library column using REST API?
Thanks,
techieHi,
We can use the following REST endpoint to get document property:
http://site/_api/web/getfilebyserverrelativeurl('/Shared Documents/filename.docx')/<property name>
https://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_File
If you want to update document library column, the following blog for your reference:
Updating SharePoint List items with SharePoint’s REST API in JavaScript
http://community.rightpoint.com/blogs/viewpoint/archive/2014/10/23/updating-sharepoint-list-items-with-sharepoint-s-rest-api-in-javascript.aspx
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
Adobe Reader error when downloading a Form (IMM5257E - required for CIC - Canadá)
I received an error when downloading a file viwh the Adobe Reader version 11.0.07.
A message like this appear:
To view the full contents of this document, you need a later version of the PDF viewer.Pat Willener!
GREAT THANKS! GREAT THANKS! GREAT THANKS!
I was using Google Chrome, and did not suspect that this could be the
problem.
I used I.E. and the download worked. So that's it.
Great thanks again.
Vilson Drehmer
Rua Balduíno Pedro Vier, 693
CEP 95.880-000 - Estrela - RS
Fone: (51) 8401.2253
E-mail: [email protected] <[email protected]>
CRA-RS 6364
2014-05-28 5:26 GMT-03:00 Pat Willener <[email protected]>:
Adobe Reader error when downloading a Form (IMM5257E - required for
CIC - Canadá) created by Pat Willener<https://forums.adobe.com/people/pwillener>in *Adobe
Reader* - View the full discussion<https://forums.adobe.com/message/6414530#6414530>
Maybe you are looking for
-
Hi Experts: I stuck into some issues while installation of the SolMan and configuring the RCA. I like to start fresh with the installation- We are installing SolMan EHP SP 20 and Oracle- I am using the instalaltion guide in the service market place.
-
Does the 3D fly over work on my iPhone 4 because I just downloaded the iOS 6 software but the new maps doesn't look like it has the 3D on my IPhone 4
-
Sync Photos - Problem if select a folder
If I try sync photos on my PC with my Ipod Video - 80Gb selecting Photoshop Album, and All photos and albums, no problems. But, If I try select a specific folder, iTunes do the sync process; in the capacity bargraph appear Photo 8,4Mb (it consider th
-
How can I unlock the masters once pulled into my layout for editing?
I am trying to edit my pages after pulling the masters into them, but I can't do it. I am right clicking on the page and I get a "unlock All on page" option, but it is not doing anything. Can someone please advise, I am new to this. I know you can un
-
I want to attach my own menu to a form. Where do I need to store the mmx so the fmx can run it? When I store it in the same folder as the fmx I keep on getting the error frm-10221 'cannot read file'.