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
Solved

file upload without using fileUpload control

Posted on 2006-12-01
7
449 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 500 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Google Maps API and PHP 25 49
Json Schema 8 32
Override MS CSS in SharePoint Online Modal Form 19 43
maven not picking latest jar instead picking old jar from .m2 12 18
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

856 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