I have a web application with symfony 2.8 and i using Microsoft one drive to save my files. since December 2015 the function below work perfectly :
public function indexAction(Request $request, File $file)
{
//RemotePAth : "https://entreprise-my.sharepoint.com/personal/admininfo/_layouts/15/guestaccess.aspx?docid=xxxxxx&authkey=xxxxxxxxxx"
//MimeType :"application/pdf"
return new Response(file_get_contents($file->getRemotePath()), 200, array('Content-Type' => $file->getMimeType(), 'charset' => 'UTF-8'));
}
now this function return always "failed to open stream: HTTP request failed! HTTP/1.1 403 FORBIDDEN"
On onedrive the file is public to everyone.
Note: Before when I open the remotepath on navigator the file is downloaded automatically. now, it's redirect to onother Url and open file