Click here to Skip to main content
16,018,353 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Upload some document for a specific folder
without use upload control in asp.net. What is the correct procedure?
Help me!
Posted
Updated 26-Jul-12 20:48pm
v2
Comments
Prasad_Kulkarni 27-Jul-12 2:40am    
Be courteous and DON'T SHOUT. Using all CAPITALS means SHOUTING on web and using all small letters means childish. Use proper capitalization. Everyone here helps because they enjoy helping others, not because it's their job.
StianSandberg 27-Jul-12 2:46am    
5'd
Sergey Alexandrovich Kryukov 27-Jul-12 2:47am    
Why without?
--SA
bbirajdar 27-Jul-12 2:52am    
file upload without upload control ? The other alternative will be to use a USB drive for moving the files..

If you want to do something, and you don't want to use the only tool that can do what you want, you need to tell us why, because you're asking the wrong question. the answer is, you can upload things from a web page using a flash component, or an activeX control, but using HTML and javascript, the thing you've decided not to use, is the only option you have.
 
Share this answer
 
Comments
bbirajdar 27-Jul-12 2:54am    
I suggest he should use a USB drive.. :)
Christian Graus 27-Jul-12 2:56am    
ROTFL !!!
The most basic method of upload is using a plain HTML form with the method "post". Its inner HTML should contain a button of the "submit" type. To post a file, you will need an input element of the type "file". Minimally, it can be something like this:
HTML
<form name="someFormName" enctype="multipart/form-data" action="/some-URL/" method="post">
    <!-- ... -->
    <input type="file" name="File"></input>
    <!-- ... -->
    <button type="submit">Some button content, like "Post it!" :-)</button>
</form>

All input elements containing data edited by the user and posted to the server side, should be marked with the attributes name with unique values; those values are used on the server side to identify, index and retrieve the post data.

More fine-grain method of posting a file could be based on JavaScript using AJAX.
Please see:
http://en.wikipedia.org/wiki/Ajax_%28programming%29[^],
https://developer.mozilla.org/en/AJAX/Getting_Started[^].

First method is based on pure HTML, the second one one HTML + JavaScript. Both methods are "raw", do not use any special control, nothing specific to ASP.NET or any other framework. By the way, for proper understanding of technology, it's very important to understand how to work with such basic techniques, not using any frameworks or libraries.

One interesting and advanced approach is using jQuery "uplodify" plug-in:
http://www.uploadify.com/[^].

See also:
http://ajaxuploader.com/?gclid=CJyZ18qmubECFQff4Aodq3QAlQ[^].

Processing the HTTP request with ASP.NET (with uploads or not) is a separate story. You can star here:
http://msdn.microsoft.com/en-us/magazine/cc188942.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx[^].

This is a minimal code sample:
http://stackoverflow.com/questions/569565/uploading-files-in-asp-net-without-using-the-fileupload-server-control[^].

By the way, this code sample was in the post in reply to the question almost identical to yours, please see? Why could not you find it by yourself? You are more interested in that than I am. Well, if you have been banned by Google or Bing, this would be a good excuse… :-)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900