Solved

file uploading without using fileUpload control

Posted on 2006-12-01
8
405 Views
Last Modified: 2012-08-14
Is it possible to upload a file from clients browser withoug using fileUpload control.
My requirement is to give user a functionality of uploading files by simply drag n drop.
0
Comment
Question by:param4r
  • 3
  • 3
  • 2
8 Comments
 
LVL 5

Expert Comment

by:dasmaer
ID: 18053074
probably not the answer you're looking for but no. For the file to be uploaded in the browser the user has to submit a form, and then the file is sent with the form. If you can get drag and drop to work on a form, and have a javascript control submit the form when this area was changed then you could replicate the behaviour you need... but the form would still be submitted and they could only drag one at a time (and have to wait for the upload).

Another way is that if you can get drag and drop to list the files, and then when the user hits submit they are uploaded... this would work, but if the user left without hitting submit then the files wouldn't get uploaded.

The only problem I can see with this is that only the input type file will accept files for upload, so making a drag and drop area to begin with would be a challenge in itself.

You could build a Java applet that would allow drag and drop, but you'd be better asking in the Java channels for how to achieve this.
0
 

Author Comment

by:param4r
ID: 18053188
Hi
Thanx for giving you valuable time to response.

My problem is not the drag n drop because that I have achieved.
The problem is I have got the names of the files to be uploaded but how to upload them without fileUpload control.

or may be

can I read the contets of the file from users comuter (e.g. c:\temp\abc.jpg) into binary stream.
0
 
LVL 5

Expert Comment

by:dasmaer
ID: 18053232
not without submitting I'm afraid, the browser won't give you access to the users file system until they click submit, and only then it will only give you access to the resources the user selected (part of browser security). If you were able to circumnavigate this then you could base64 the file and send it by AJAX... its just getting the file without the user hitting submit that can't be done.
0
 

Author Comment

by:param4r
ID: 18053293
thanx,

I know it is possible, but don't know how.
Because people already have developed controls like this and selling them on the net.

There should be some trick they are doing, and/or using multiple technologies like java, Ajax and so on....

As soon as I got the answer I will share with you.


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:dasmaer
ID: 18053317
If you use a Java applet then you can get it to make the connection without input from the user as it can make its own connections.
0
 
LVL 5

Accepted Solution

by:
pdotnet earned 500 total points
ID: 18054949
I know the behaviour you're trying to achieve, you can find an answer how to do this here:

http://sheetaljain.com/blog/2005/10/gmail-file-attachment-secret-inputfile.html

There is a typeo in the example however, the last line should be:   filecontrol.click();   and NOT file1.click();

This is also how GMail does the 'behind the scenes' file upload as you type.  Each of those attachment boxes are an IFrame and in each of those iframes are <forms> that post just the file to the server in a seperate request.  

0
 

Author Comment

by:param4r
ID: 18058742
Thanks pdotnet,

The trick in the url provided by you is great.

But my requirement is I already have filenames in my testbox control and dont want user to select files because they already have dragged the files to my flash player control and filenames are filled in the textbox.

Now I want to upload these files.
0
 
LVL 5

Expert Comment

by:pdotnet
ID: 18070101
Thanks param4r.

Perhaps you should look for a way to trigger a file upload using flash.  As far as I know, flash alone doesn't have that ability but I've seen proof of concepts that have a flash file browser (Similar to your drag and drop control) that interacts with an <input type="file"> on a hidden frame.  Perhaps that's the way to go.

http://www.impulsedigital.com/idio/idio-v1/

Downloadable source is on there too.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now