Web Script Which Returns a Repository File
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2010 06:53 PM
Hello All,
Maybe this is a stupid question, but I can't find any examples or documentation of how I would write a very simple web script which would just return a single file that is on the repository. I don't want to display a list of files on the repository, or some other widget-like thing, I want to return the file itself in response to the request. Is that possible? If so, could anyone point me in the right direction?
Many thanks,
brokenindex
Maybe this is a stupid question, but I can't find any examples or documentation of how I would write a very simple web script which would just return a single file that is on the repository. I don't want to display a list of files on the repository, or some other widget-like thing, I want to return the file itself in response to the request. Is that possible? If so, could anyone point me in the right direction?
Many thanks,
brokenindex
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2010 05:13 AM
You don't need to implement a new webscript for this goal.
You can use the DownloadContentServlet to return a file in the response.
You have to perform an HTTP GET request with the following URL:
More information here:
http://wiki.alfresco.com/wiki/URL_Addressability#DownloadContentServlet
Hope this helps.
You can use the DownloadContentServlet to return a file in the response.
You have to perform an HTTP GET request with the following URL:
/alfresco/download/<direct|attach>/<workspace>/<store>/<nodeId>/<filename>
More information here:
http://wiki.alfresco.com/wiki/URL_Addressability#DownloadContentServlet
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2010 01:51 PM
Thanks! That is so helpful. Along the same lines, is there a way to return an HTML file such that it would be loaded by the browser making the request, and now downloaded?
-A
-A
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2010 02:36 PM
Ah, I get it, you dictate whether the guestDownload file is downloaded or loaded into the browser with the < attach | direct > option.
/alfresco/download/<direct|attach>/<workspace>/<store>/<nodeId>/<filename>
Thanks again.
