Home » Eclipse Projects » Remote Application Platform (RAP) » PDF, JPG, DOC etc.
| | |
Re: PDF, JPG, DOC etc. [message #657264 is a reply to message #657062] |
Wed, 02 March 2011 08:57 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Edin,
due to browser security policies, it's not possible to show a file from
the local file system (forced by javascript). I will suggest to register
the "file.pdf" as a resource on the server and show it to the clients
with http protocol.
HTH,
Ivan
On 3/1/2011 3:59 PM, ededagic wrote:
> Hello,
>
> im trying to show a pdf doc in an browser Object. When i set the url
> with setUrl method and give some http adress, everything works fine. i
> can change the url to another http url and browser reloads to the new
> pdf. But if i want to show some pdf from local file system i.e.
> browser.setUrl("file:///d:/backup/file.pdf");
> file doesnt get shown. If i add this file url manually to firefox, it
> gets shown. any idea, what the reason might be?
>
> Greetings Edin
|
|
| |
Re: PDF, JPG, DOC etc. [message #658399 is a reply to message #658370] |
Tue, 08 March 2011 10:20 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Edin,
the RAP FAQ page that explain how to register a resource (file/folder)
is here:
http://wiki.eclipse.org/RAP/FAQ#How_to_register_a_file.2Ffol der_as_resource.3F
The important point here is that your folder must be under your project
folder. For example, to map the folder ".../<project_name>/backup" to
|"http://<url_to_rap_server>/backup"| use:
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/backup"
base-name="backup">
</resource>
</extension>
HTH,
Ivan
On 3/8/2011 11:05 AM, ededagic wrote:
> Thnx Ivan,
>
> can you give me an example how to register a ressource?
> I have an order c:/backup and the apps http is
> http://127.0.0.1:8080/webapp?startup=hello
> the content of backup increases every time a user uploads sth. He also
> have a list of backup files and i want him be able to open that file
> by doubleclick in rap browser. that means, i must somehow register not
> only a static pdf file, but c:/backup folder and access all of the
> backup files with http, even the new uploaded one, without restarting
> the app and registering it the plugin.xml
> I found this on Eclipse RAP FAQ Page:
> <extension
> point="org.eclipse.equinox.http.registry.resources">
> <resource
> alias="/"
> base-name="resources">
> </resource>
> </extension>
> can you explain me how to use it on my given folder and my app http
> adress?
> Thnx, Edin
|
|
|
Goto Forum:
Current Time: Fri Mar 29 13:30:25 GMT 2024
Powered by FUDForum. Page generated in 0.02422 seconds
|