# Accessing CSV from File Manager to parse using Javascript returns 401

**URL:** <https://community.fliplet.com/t/accessing-csv-from-file-manager-to-parse-using-javascript-returns-401/674>\
**Category:** Get Help\
**Created:** [July 31, 2024, 11:59am UTC](https://community.fliplet.com/t/accessing-csv-from-file-manager-to-parse-using-javascript-returns-401/674 "2024-07-31T11:59:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyFromLeeds](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AndyFromLeeds](https://community.fliplet.com/u/AndyFromLeeds)\
**Post date:** [July 31, 2024, 11:59am UTC](https://community.fliplet.com/t/accessing-csv-from-file-manager-to-parse-using-javascript-returns-401/674/1 "2024-07-31T11:59:53Z")

</div>

Hi,

I am trying to use JavaScript to parse a csv file that is uploaded in a form and gets stored at an address similar to: [https://api.fliplet.com/v1/media/files/\*\*\*\*\*\*\*/contents/\*\*\*\*\*.csv](https://api.fliplet.com/v1/media/files/ *******/contents/*****.csv)

I am using Papa Parse since it is a Fliplet approved library to do this by setting a variable called ‘csvUrl’ to the above URL and passing it as follows:

Papa.parse(csvUrl, {  
download: true,  
complete: function(results) {  
}  
});

I get a 401 response when doing this. If I enter the same URL into a browser tab the file downloads just fine, it seems to be only when accessing programmatically. I can’t see anywhere to set any permissions to resolve this.

Can someone tell me what the missing piece to this is please.

Thanks

Andy

---

<div class="post-metadata">

**Author:** ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)\
**Post date:** [July 31, 2024, 1:17pm UTC](https://community.fliplet.com/t/accessing-csv-from-file-manager-to-parse-using-javascript-returns-401/674/2 "2024-07-31T13:17:08Z")

</div>

Hi Andy,

It is likely you need to authenticate the file before passing it to Papa Parse. See instructions here: [Media JS APIs | Fliplet Developers Documentation](https://developers.fliplet.com/API/fliplet-media.html#authenticate-encrypted-files)

All files stored in Fliplet need to be authenticated to be used outside Fliplet Studio including in JS.

Thanks,  
Deb

---

<div class="post-metadata">

**Author:** ![AndyFromLeeds](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AndyFromLeeds](https://community.fliplet.com/u/AndyFromLeeds)\
**Post date:** [July 31, 2024, 6:31pm UTC](https://community.fliplet.com/t/accessing-csv-from-file-manager-to-parse-using-javascript-returns-401/674/3 "2024-07-31T18:31:15Z")

</div>

Great thanks Deb
