Solved

file uploading without using fileUpload control

Posted on 2006-12-01
8
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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
 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

688 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