DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Ajax & Javascript
Reload this Page file upload by clicking a link instead of button
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: May 2009
Smile file upload by clicking a link instead of button - 05-03-2009, 03:37 AM



I need an way to upload a file by clicking a link instead of button(<input type="file" name="somename"/>). This feature has been newly added to GMail, to attached a file we need to click a link.

Any ideas or code of how this can be done are needed.

Thanks
Attached Images
File Type: jpg file upload using link.jpg (15.9 KB, 0 views)
Reply With Quote
  (#2 (permalink)) Old
Moderator
 
gdboling's Avatar
 
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Default 05-04-2009, 12:04 PM

When you click the link in gmail, all it does is reveal a fileupload form that gets submitted when the form's 'Send' button is clicked. Are you wanting to do the same thing or are you really wanting to submit a form with a link?


Thanks

Gregg Bolinger
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: May 2009
Thumbs up need the same functionality as gmail - 05-04-2009, 11:04 PM

Quote:
Originally Posted by gdboling View Post
When you click the link in gmail, all it does is reveal a fileupload form that gets submitted when the form's 'Send' button is clicked. Are you wanting to do the same thing or are you really wanting to submit a form with a link?
hi gdboling,

I need the same functionality as gmail, i.e fileupload form that gets submitted when the form's send button is clicked.

thanks.
Reply With Quote
  (#4 (permalink)) Old
Moderator
 
gdboling's Avatar
 
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2008
Default 05-05-2009, 02:11 PM

What have you tried? If I were doing it I'd do one of a few things..

1. Have a hidden div with a fileupoad element and when you click a link to add a file, show the div

2. Have some JavaScript generate your fileupload element on the fly. That way you can dynamically add more than 1 file to be uploaded (this is more like gmail)

3. Make an AJAX request to the server for the HTML bits to show a fileupload element. This also allows for more than 1 file to be uploaded per form.


Thanks

Gregg Bolinger
Reply With Quote
Reply

Thread Tools
Display Modes

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
Greying out Submit button garvagh Accessibility 3 10-08-2008 07:26 AM
How to enable 2 features in Eclipse (list functions in file & link to function) AtomicPenguin Eclipse 0 09-25-2008 03:58 PM
Link with image and text centered vertically DanielB CSS & HTML 1 09-09-2008 11:51 AM
Applet to upload files and folder over HTTP jfileupload Java 2 03-11-2008 05:29 AM
How to link folders between projects? netverde Eclipse 0 03-07-2008 10:47 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com