Applet, file & resource

M

Manuel

Hello.
In an applet:
¿How can I do to, by clicking a button, download a file?
¿And if the file is in a resource?
Thanks.
 
A

Andrew Thompson

..In an applet:

Sand-boxed or trusted? Deployed using standard HTML or JNLP?
¿How can I do to, by clicking a button, download a file?

Is it the 'clicking a button' or the 'download a file'
that you are having trouble with?

At the same site or a different site?
¿And if the file is in a resource?

You mean if it is in one of the Jars added the run-time
class-path of the applet using the 'archive' attribute?
That makes it simpler.

BTW - never ignore the possibility of putting a simple
HTML link to the (un-Jar'd) resource on the server, and
ensure the server has the correct mime-type configured
for that file type. Most browser/OS combos. will know
exactly what to do with/how to handle most file types
that might be downloaded.

BTW (2) - What is the type of files you want to offer
the user on the 'click of a button'? Images? Music?
Viruses? ..
 
M

Manuel

Andrew Thompson a formulé ce viernes :
Sand-boxed or trusted? Deployed using standard HTML or JNLP?


Is it the 'clicking a button' or the 'download a file'
that you are having trouble with?

At the same site or a different site?


You mean if it is in one of the Jars added the run-time
class-path of the applet using the 'archive' attribute?
That makes it simpler.

BTW - never ignore the possibility of putting a simple
HTML link to the (un-Jar'd) resource on the server, and
ensure the server has the correct mime-type configured
for that file type. Most browser/OS combos. will know
exactly what to do with/how to handle most file types
that might be downloaded.

BTW (2) - What is the type of files you want to offer
the user on the 'click of a button'? Images? Music?
Viruses? ..

I want to make a signing applet to remote control the pcs of my
customers.

I make it in Delphi, and in c# than a desktop application but now I
want to make if it is posible like a Java Applet, I'm new in java.

The soft puts, if not exists, winvnc.exe and the .ini directly in the
home folder of the PC and with 2 buttons "Connect", "Disconnect" my
customer controls my connection to the PC, because I execute and
control the process.

My first problem is than I don't know how to put a file that is my
server in System.getProperty("user.home") when my user click the
connect button.

Can you help me ?
 
R

Roedy Green

Hello.
In an applet:
¿How can I do to, by clicking a button, download a file?
¿And if the file is in a resource?
Thanks.

See http://mindprod.com/products1.html#HTTP

for sample application see
http://mindprod.com/products1.html#SUBMITTER

You must sign the Applet unless the file in on the server in the file
tree of the Applet jar.

See http://mindprod.com/jgloss/resource.html
for how to read a resource.

E.g. http://mindprod.com/jgloss/image.html
for how to read a resource image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,243
Latest member
Weeb3PRAgency

Latest Threads

Top