Solved

file upload without using fileUpload control

Posted on 2006-12-01
7
447 Views
Last Modified: 2008-02-01
I want to give drag drop and upload functionality in my web page.
I have achieved the drag and drop part. Now I have file names in a text box and I want to upload all files listed in the text box without the help of fileUpload control.

Is there any way to read client files into binary streams. I tried to use file:\\\c:\temp\abc.jpg but it reads from the server only.
0
Comment
Question by:param4r
7 Comments
 
LVL 12

Expert Comment

by:AmigoJack
Comment Utility
this is considered hazardous and thus not supported by browsers. think of a website which has javascript code that auto-fills (for example) "C:\autoexec.bat" into the upload-control and then automatically submits the form?

believe me, its better the way its now :) if using uploads via http, the user HAS to use the file-upload controls manually
0
 

Author Comment

by:param4r
Comment Utility
Thanx AmigoJack,

I understand the limitation.

Is it possible to read data into binary stream from my image control.
0
 
LVL 6

Accepted Solution

by:
nbkbar7 earned 500 total points
Comment Utility

AmigoJack is correct. I user interaction is accaptable as in a message confirming that the user wants to allow it you could use this solution...

http://www.experts-exchange.com/Web/Web_Languages/Q_20639591.html?query=javascript+file+upload&clearTAFilter=true
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 12

Expert Comment

by:AmigoJack
Comment Utility
"into binary stream from my image control"... i dont understand this. with javascript you can change the source of an image of an <image> tag, yes. the upload-functionality doesnt care about images, archives or else...
0
 

Author Comment

by:param4r
Comment Utility
thanx nkkbar7,

I think solution provided in the url will work for me.

0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
you can write a javascript function (invoked from a button of your choice) which gets the filename from your select box, inserts it in a input tage of type=file, and then submits the form around that input tag (which has to be enctype=multipart/form-data, for obvious reason). You even can have multiple such input tags in that form and so submitt all files at once.
0
 

Author Comment

by:param4r
Comment Utility
Dear nkkbar7,

The solution provided by you in the url seems to be perfect for my requirement.
But sadly I am not able to use it, my code stops at the line where adodb.stream is trying to load the file from my hard disk

BinaryStream.LoadFromFile("d:\\temp\namrata.jpg");  

the above line is not being executed successfully, can you put some light.

I think if this is sorted out remaing code will not give any problem.

Thanx


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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 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

10 Experts available now in Live!

Get 1:1 Help Now