question

MAFarooqui-1993 avatar image
0 Votes"
MAFarooqui-1993 asked MAFarooqui-1993 answered

How to upload file in sub folder using JSOM in SharePoint

Hi,

How can I upload a file to Subfolder in Document Library using JSOM...
At some pointer , i tried..fileCreateInfo.set_url but not working...
Any idea/suggesiton ..please
Thanks & BR

office-sharepoint-server-developmentoffice-sharepoint-server-customization
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT edited

Hi @MAFarooqui-1993,

You could upload file to sub folder like this:

 createInfo.set_url("https://yourSiteCollection/Documents/folder1/subFolder1/" + fileName);


Reference: https://sharepoint.stackexchange.com/questions/213789/uploading-file-to-document-library-using-jsom

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MAFarooqui-1993 avatar image
0 Votes"
MAFarooqui-1993 answered

Thanks Michael,
I think I was missing slash (/) after folder name , now it worked...

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.