it is possible to access data in another site collection via javascript object model. Try to use full (absolute) url of another site when create SP.ClientContext. See example e.g. here: Can we access list from other site collection sites using javascript object model.
Create Folder and add document in library located in another sub-site using javascript or jquery.
I am trying to create a folder by creating a client request to another subsidiary, but no method works for me.
-> http://......./subs/spain/installationdatabase/pages/installationupload.aspx
Here is my javascript file and I want to create a new folder and upload selected documents whenever I press a button on this site.
-> https://...../subs/spain/databackup/Data-backup
This is my library, where I want to create a folder and upload the files selected in the previous page.
I am trying to create a client request using SP.ClientContext("/subs/spain/databackup/Data-Backup");
Can anyone please solve this query.
2 additional answers
Sort by: Most helpful
-
RaytheonXie_MSFT 31,071 Reputation points Microsoft Vendor
2022-05-19T02:44:50.337+00:00 Hi @Gadhiya, Jenis ,
Per my test, we can create a document library and copy the files selected to the library. But we are unable to copy the files to a subfolder of the library because of the SP.MoveCopyUtil.copyFile can only support copy files between library level. You can refer to following code
203531-backupfile.txt
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
Gadhiya, Jenis 21 Reputation points
2022-05-24T14:04:52.347+00:00 Hi @RaytheonXie_MSFT,
I resolved the issue just today, Your code helped me a little bit, But I gathered code from 3 to 4 places and attached it together.
Now the whole system is working.I tried uploading the code, but I am facing some error.
Have a nice day,Thanks
Jenis Gadhiya
205181-upload-file-in-backup-folder.txt