Is there any way to download an applet embedded in a webpage of a site www.abc.com1, to one's system?
Or is it possible to extract its code for offline use?
E.G. http://www.falstad.com/dotproduct/
For the link provided, I see the link "Zip archive of this applet.". It contains the applet jar, html page and the java source file.
You can try to inspect the page source to see the archive file it is using. In this case, it appears as if it is using http://www.falstad.com/dotproduct/dotproduct.jar. You can use this in a project, but the source will not be attached.
The applet at http://www.falstad.com/dotproduct/ can certainly be used off-line. I tested it just to make sure.
You would need to download the dotproduct.jar (referenced in the page - are you familiar with "View Source"?) to the local file-system then create an HTML (or use a copy of Paul Falstad's own HTML) to launch it.
You might try "Save page as" for the 2nd part, but I am not confident that that would also download the Jar of the applet itself.
Of course, it would be courteous to let Paul know what you are doing. You might find he will be prepared to send you a Zip of the HTML/applet.
Related
In Fitnesse wiki how do i allow file Download. I have a file on a location in my local which i am trying to pass it to fitnesse wiki.
{{{"TEST"; }}}
Using this i am able to pass Anchor tag to wiki screen but when i click on it nothing happens. I am not sure y this happens in fitnesse.
i have tried using Object and Embed HTML tags options those are not working at all. i need to show a hyperlink of file and make it downloadable to user who runs fitnesse test.
"TEST";
FILE should get downloaded via browser it is not working as expected.
As far as I'm aware this is just 'normal' browser behaviour. The FitNesse page is loaded via http:// and therefore the browser will not open any file:// links. See for instance How to specify a local file within html using the file: scheme?
FitNesse will serve files located in its 'files-section' over http, so they can be accessed.
A workaround that you could consider is: make some code (in a fixture) to copy the file from its current location into the files section and then link to it there (using a http link).
Here is the case.
User should be able to open MS Word document which is located somewhere in the network (ie. \remote\machine\documents\document_to_edit.docx) with MS Word 2007 by clicking link in the browser. Browser is IE7+.
Edit the document, close it and save it (no "Save as..." just "Save") in the same place in the network (\remote\machine\documents\document_to_edit.docx)
Is that at all possible? If so how should I do that?
Don't think this is relative, but I'm using JAVA + Wicket for my web application.
EDIT:
Any suggestions are welcome.
Main thing is - open file as it was on your computer and save it after edit.
(Read update below)
Short answer: not possible.
Long answer: When you open anything from a browser, even some local file, it will open the given file from the browser cache (or some temporary download directory) but not the original file linked. Therefore, after you save the changes the copied file will be updated.
Added:
Ok, after I thought about it for a while, there could be some ways to do it in intranet application. Here's how: Java applet: run native code from browser?
So, basically, you will serve the applet which will communicate with your javascript (I guess this way would be easiest to implement) (info on how to do it) and send a network path to the applet. Applet will start winword.exe passing it the required parameters.
Or, there's another option with ActiveX: http://codereflex.net/how-to-run-exe-on-webpage/ . The downside is - it works only with IE, but that seems what you need anyway.
IE can open \\server\share\file.docx type links and it opens the original file, not a downloaded version. You may need to add the domain of your http server to trusted sites in the security settings of IE first though. Have tested this and it does work
Kind of hard to explain in one line but my problem is essentially like this:
I made a java applet that I want to run on a web page that I packaged into a .jar file. I'm able to get the applet working fine using the <applet> tag but the problem is, if the user views the page source, they will see:
<applet archive="directory/program.jar">
Assuming .jar files can be easily opened and all the class files decompiled, all the user would have to do is go to www.url.com/directory/program.jar to download my .jar and they would have all my source code :(
So I'm wondering if there is either a way to protect my code/jar from being decompiled (other than obfuscation) or to use some kind of server-side script to feed the contents of the .jar directly to the browser from a server-side location not publically visible.
Any help is appreciated.
This is fundamentally impossible.
Java applets run the client.
Anything that runs on the client can be disassembled and modified by a sufficiently advanced user.
You should move your sensitive logic to the server and invoke it using HTTP requests ( and remember that the user can use Fiddler).
While you're at it, you should probably replace your applet with HTML and Javascript.
Other than obfuscation or encryption, no--one way or the other, the browser will have access to the jar.
You might be able to create an applet that loads more functionality at runtime.
There is no effective way to block access to the source code of any page; for the page to be readable by browsers and search engines, the source code has to be accessible, and therefore can be viewed and/or copied. That's just how the web works. HTML is sent as a text document and interpreted client-side.
Disabling the right-click is little more than an annoyance, and it works sporadically in alternative browsers. Even if you succeed, the View Source option in the menu is always present. The viewer could also use a download tool such as Wget, or even get the page from the Google cache without visiting your site at all.
Edit: Oops! I misunderstood your question. You should follow #SLaks advice and "move your sensitive logic to the server and invoke ot using HTTP requests ( and remember that the user can use Fiddler)."
While quantum mechanics do rule the universe, they have less of a grip on your code than you might suspect. You cannot both deploy code to the client browser and not deploy code to the client browser. You have the option of doing one or the other.
You can prevent direct browsing to your .jar file by locating it beneath the WEB-INF directory in your WAR file. This will also prevent <applet archive="directory/program.jar"> from working.
Once the jar is beneath the WEB-INF directory you will need something to feed the resource to the client browser; the Spring resources servlet is good for this (If you are using Java and Spring). I feel confident that other such tools exist. With the Sprint resours servlet, your would deploy your applet with something like this: <applet archive="resource/program.jar".
If you write your own resource distributor, you can add security to make it harder to get the jar file; perhaps add a header to your requests like IRGud: <user_id here> and fail any request that does not have that header (or acceptable contents in the header).
I'm developing a JSP application, and I want to be able to upload the contents of a directory to the server. So the user will select the directory he wants to upload, and somehow all its contents will be uploaded.
Can't be done with regular HTML/Javascript, you have to use either Java or Flash.
There is no support for this in HTML (only uploading of a single file) so there is nothing you can do in your JSP. If you want to do this in java you will have to have something client side, like a signed Applet or a jar that the user downloads and runs.
Looks like it's time for a Framework! Struts2 can handle this type of jobs well and is easy to start with. Here you can take a look at a File Upload sample.
As said, there is no way to do this in JavaScript/HTML.
If you do not want to use a Java Applet (they are clunky and your users may not have Java installed), you can let people upload a zip file and extract it on the server (there is support for this in the Java standard API). Both Windows and Mac OS allow the clients to zip a folder by right-clicking.
I'm generating a custom Word documents in my web application using the .mhtml format. Previously this was working fine. I assemble the document and write it to a directory then give a link to the file (with a .doc extension). Recently my template has changed to include embedded images. Now when I attempt to save and open a file from the web app, Word refuses to open it. It just shows a message "Cannot open file .." with the path. When you view the help it says something about lack of memory which is bogus.
When I open the exact same file from my localhost server it works fine. The two files (local and production) are identical. I've tried adding the site as a Trusted Site - no luck.
Any ideas?
Jeff
Sounds like the webserver does not annotate with a correct mimetype.
Is the downloaded file identical with the one present in the webserver? Do a byte-wise comparison.
Also try other browsers to see. IE has some quirks.
Solved issue by switching to plain HTML format with images as external links.