Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

file upload without using fileUpload control

Posted on 2006-12-01
7
Medium Priority
?
454 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
ID: 18053174
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
ID: 18053218
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 1500 total points
ID: 18053227

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
Industry Leaders: 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!

 
LVL 12

Expert Comment

by:AmigoJack
ID: 18053303
"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
ID: 18053373
thanx nkkbar7,

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

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 18053396
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
ID: 18059114
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…
Suggested Courses

972 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