Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2010, 09:42 AM   PM User | #1
ajaybabu.darna
New Coder

 
Join Date: Dec 2009
Posts: 20
Thanks: 4
Thanked 0 Times in 0 Posts
ajaybabu.darna is an unknown quantity at this point
file uploading in ajax

how can we do ajax file uploading in html through javascript??
ajaybabu.darna is offline   Reply With Quote
Old 02-16-2010, 03:18 PM   PM User | #2
bdl
Regular Coder

 
Join Date: Apr 2007
Location: Camarillo, CA US
Posts: 590
Thanks: 4
Thanked 83 Times in 82 Posts
bdl is an unknown quantity at this point
Technically, you can't. JavaScript cannot access local files on the filesystem as a security measure. You can, however, use a method that utilizes Flash or an IFRAME element to approximate an "Ajax file upload". There are dozens if not hundreds of good tutorials, examples and frameworks online for this. Please do a basic Google search.
bdl is offline   Reply With Quote
Users who have thanked bdl for this post:
ajaybabu.darna (02-17-2010)
Old 02-16-2010, 04:05 PM   PM User | #3
eak
Regular Coder

 
eak's Avatar
 
Join Date: Jun 2002
Location: Nashville, TN
Posts: 354
Thanks: 0
Thanked 26 Times in 26 Posts
eak is on a distinguished road
This can be done with Firefox 3.6+

https://developer.mozilla.org/en/Usi...b_applications

https://developer.mozilla.org/En/DragDrop/DataTransfer
__________________
eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."
eak is offline   Reply With Quote
Users who have thanked eak for this post:
ajaybabu.darna (02-17-2010)
Old 02-19-2010, 05:39 AM   PM User | #4
ajaybabu.darna
New Coder

 
Join Date: Dec 2009
Posts: 20
Thanks: 4
Thanked 0 Times in 0 Posts
ajaybabu.darna is an unknown quantity at this point
Quote:
Originally Posted by bdl View Post
Technically, you can't. JavaScript cannot access local files on the filesystem as a security measure. You can, however, use a method that utilizes Flash or an IFRAME element to approximate an "Ajax file upload". There are dozens if not hundreds of good tutorials, examples and frameworks online for this. Please do a basic Google search.
Hello sir...
sorry i dont know whether this question related to this site or not
i have uploaded as u said...
the problem is that when i am doing other operation like save or edit,
i am using a java servlet to the database operation after completion of operation i am redirecting to one jsp.

Actually i need to perform save two types of data....
1. a plain text or 2. a uploaded file like image
it is working fine when i am using plain text and not uploading anything ..and redirecting to a jsp.
But it is not working fine after uploading using this ajax and iframe.All database operations are happening except this redirect operation, can u please tell me the solution .........
or atleast where can i find solution for this type of uploading
ajaybabu.darna is offline   Reply With Quote
Old 06-23-2012, 06:27 AM   PM User | #5
nidhya
New to the CF scene

 
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
nidhya is an unknown quantity at this point
How to upload a particular file using jsp or servlet coding and run in firefox?
nidhya is offline   Reply With Quote
Old 07-05-2012, 09:39 AM   PM User | #6
blandickclara
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
blandickclara is an unknown quantity at this point
hello friend , i also want to know answer of this question .i am designing an website and i am face some problem in that particular task. www.healthinsuranceireland.org
blandickclara is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:13 AM.


Advertisement
Log in to turn off these ads.