I'm using the Parse PHP SDK and trying to upload an image. The file successfully saves, however the URL for the file returned by the getUrl() ParseFile method returns a 403 forbidden when I try to view it. Viewing the file via the Parse data browser also returns a 403 error. I'm using Laravel, and have tried several different methods:
1) Upload the file to parse, save the object against the user and then access the File via the getURL() method:
$contents = Input::file('profile_picture');
$file = ParseFile::createFromData($contents, "profilePicture_".$contents->getClientOriginalName());
Auth::user()->set('profilePicture', $file);
// In My View
<img src="{{Auth::user()->get('profilePicture')->getUrl()}}"/>
The URL returned returns a 403 forbidden.
2) Upload the file to Parse and store the URL against the user
$contents = Input::file('profile_picture');
$file = ParseFile::createFromData($contents, "profilePicture_".$contents->getClientOriginalName());
Auth::user()->set('profilePicture', $file->getUrl());
// In My View
<img src="{{Auth::user()->get('profilePicture')}}"/>
I have also tried both the above using:
$file = ParseFile::createFromData($contents, "profilePicture".$contents->getClientOriginalExtension());
An example of the URL being returned looks like: http://files.parsetfss.com/2ed712aa-99d8-4df1-8100-a1f907042d43/tfss-37d8f8e3-b8fc-4980-8d45-4a24957a5dc0-profilePicturepong.jpg