You need to sign in to do that
Don't have an account?
Sumant Kuchipu 1
How to view file instead of downloading from Apex/VF?
Hi,
When a user clicks on a link, I called VisualForce and then call Apex that calls REST api to "box" and gets download link. I was able to download file from that link provided by BOX using REST api. (see download link below, I made it short since the download link is too big) .
and the file is directly downloading in the next page but I need to open the file instead of downloading.
This is download Link returned from Box api:
Is there any possiblities to convert that Download to open on new window or same window?
That would be great if anyone could give the clue, I apreciate your help.
Thanks,
Sumant
When a user clicks on a link, I called VisualForce and then call Apex that calls REST api to "box" and gets download link. I was able to download file from that link provided by BOX using REST api. (see download link below, I made it short since the download link is too big) .
and the file is directly downloading in the next page but I need to open the file instead of downloading.
This is download Link returned from Box api:
https://dl.boxcloud.com/d/1/4cp_Tu5yjx8avwjkdIwL1Z4Du4iV8FkvvpQsFPco4fbvdvOvusVR7N89Tca-QOGarhUBNEBV5gKgCh6mj4z1n7URaroUCkRvnD5bTei5U1AuQ33BA../downloadVisualForce:
<apex:page controller="BoxController" action="{!fileOpen}"> </apex:page>Apex Code:
public PageReference fileOpen(){ PageReference page; try{ String bFileId=String.valueof(ApexPages.CurrentPage().getparameters().get('bFileID')); String fileDownloadURL= fileFromBoxDownload(bFileId);// This api calls to Box api and get download URL, which is avove link page = new PageReference(fileDownloadURL); page.setRedirect(true); } catch (Exception e){ System.debug(' **** File fileOpen Exceptions '+e); } return page; }
Is there any possiblities to convert that Download to open on new window or same window?
That would be great if anyone could give the clue, I apreciate your help.
Thanks,
Sumant