Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > uploading files

Reply
Thread Tools

uploading files

 
 
bob@coolgroups.com
Guest
Posts: n/a
 
      04-01-2009
Is there any way to allow users to upload files from their PC in a
Java applet?
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      04-01-2009
On Apr 2, 2:19*am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> Is there any way to allow users to upload files from their PC in a
> Java applet?


Yes.

Either:
1) Sign the applet to get access to the local file
system.
...or..
2) Launch it using the JNLP API (using Java 1.6.0_10+)
and use the javax.jnlp classes to get access to the
local file system.

The server will also need to have some facility to
accept file uploads.

--
Andrew T.
pscode.org
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      04-01-2009
Andrew Thompson wrote:
> On Apr 2, 2:19 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>> Is there any way to allow users to upload files from their PC in a
>> Java applet?

>
> Yes.
>
> Either:
> 1) Sign the applet to get access to the local file
> system.
> ..or..
> 2) Launch it using the JNLP API (using Java 1.6.0_10+)
> and use the javax.jnlp classes to get access to the
> local file system.
>
> The server will also need to have some facility to
> accept file uploads.
>
> --
> Andrew T.
> pscode.org


If he uploads to the server the applet came from, signing is not necessary.

--

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-01-2009
Matt Humphrey wrote:
> "Knute Johnson" <(E-Mail Removed)> wrote in message
> news:49d397de$0$23152$(E-Mail Removed). ..
>> Andrew Thompson wrote:
>>> On Apr 2, 2:19 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>>>> Is there any way to allow users to upload files from their PC in a
>>>> Java applet?
>>> Yes.

>
>> If he uploads to the server the applet came from, signing is not
>> necessary.

>
> Signing is needed for the applet to read from the local file system.


Yep.

Arne
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-01-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Is there any way to allow users to upload files from their PC in a
> Java applet?


A signed applet can:
* browse and pick one or multiple files
* upload via HTTP or FTP

If you are interested in some code to start with (it is not
production quality) then I have some demo code on the shelf.

Arne
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      04-02-2009
On Apr 2, 9:57*am, Arne Vajh°j <(E-Mail Removed)> wrote:
> Matt Humphrey wrote:

....
> > Signing is needed for the applet to read from the local file system.

>
> Yep.


I should have been a little more verbose in my
'option 2' (now trimmed).

This is the embedded applet using Java 1.6.0_10+
option, and it can allow even unsigned applets to
access the local file system. The user is prompted
for permission at the exact moment the code goes to
show the file chooser.

This is in some ways a better user experience than
the usual 'signed applet', in that
1) The prompt for extra permissions is more closely
associated with the user clicking the 'Select File/s
to Upload' button (whatever).
2) It is more specific about why the extra permissions
are required (AFAIR there is mention of something like
'the code would like to access the local file system
- Allow Yes/No'
3) The user can refuse the prompt the first time,
then change their mind and immediately be prompted
again (it can be tricky getting a second 'trust prompt' for a signed
applet that the user has initially
refused extra permissions).

Even with the sandboxed/JNLP option, the applet can
still be signed but sandboxed, and AFAIU, it will
act just the same (but I have not tested it, since I
only bother to sign applets when they are not JNLP
based and require trust).

--
Andrew T.
pscode.org
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      04-02-2009
On Wed, 1 Apr 2009 09:19:58 -0700 (PDT), "(E-Mail Removed)"
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone who
said :

>Is there any way to allow users to upload files from their PC in a
>Java applet?


If you want to look at files on the local machine, you need to sign
your Applet. You can talk to the server from which you were loaded
without signing.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Danish studies of 10,000 birds killed revealed that almost all died in
collisions with buildings, cars and wires; only 10 were killed by windmills.
Alternative energy sources are absolutely necessary.
Global warming will kill birds and bats, as well as other species,
in much greater numbers than wind power."
~ Dr. David Suzuki
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp uploading vs. control panel uploading Dung Ping HTML 10 01-16-2006 10:43 AM
Uploading files to Windows Server raymond chiu ASP .Net 2 01-12-2006 06:10 PM
Problems: uploading files have Chinese named files Andrew Chan ASP .Net Web Services 0 04-16-2004 07:50 AM
Uploading config files to Pix 515 michael Cisco 1 02-06-2004 08:55 PM
Uploading files with cgi - binary-files are truncated !? dermoon Python 0 10-08-2003 10:21 PM



Advertisments