How to upload file without using file control...???

Hi,

I have List of file path of Client. say "C:/WordDoc/Document1.doc". Now i want to upload this file to server.
I dont want to use File Upload or Input File HTLM Control. Only i have is Path in some lable or text box.

Now, How to upload this file from client to server? I dont have idea on it.

Java has Third party API for uploading but i dont have idea on it.

Can one help me on it.

Whether some ActiveX or API avialble to do so.

Thank You In Advance...!!!

 

---Bhavin

0
bbgajjar
3/23/2007 10:51:54 AM
asp.net.client-side 24353 articles. 2 followers. Follow

6 Replies
1309 Views

Similar Articles

[PageSpeed] 55
Get it on Google Play
Get it on Apple App Store

I can't see any worthwhile reason to not use the FileUpload control, but.....

http://www.aspfree.com/c/a/.NET/HTTP-File-Upload-without-User-Interaction-using-dot-NET/

Hope this helps!


Josh Stodola ← Come check out my blog!
0
JoshStodola
3/23/2007 2:59:20 PM

Check this out: Any problems just say it, I've done it before!

 

http://forums.asp.net/thread/1298859.aspx 


Best regards,
David Ribeiro
0
dvd
3/24/2007 2:35:50 PM

dvd.ribeiro:
Check this out: Any problems just say it, I've done it before!

Nice ego, and that link was totally irrelevant to this guy's issue Hmm


Josh Stodola ← Come check out my blog!
0
JoshStodola
3/24/2007 4:54:04 PM
JoshStodola:

dvd.ribeiro:
Check this out: Any problems just say it, I've done it before!

Nice ego, and that link was totally irrelevant to this guy's issue Hmm

Oh really useless!!!!

 

Here it goes, sorry, thought it was on that post:

Put this on the top:

using System.IO;

using System.Web.Security; //(not sure about this one) 

 

And then:

if (fileUpload.HasFile) / If the file upload has file
                {
                    type= System.IO.Path.GetExtension(fileUpload.FileName).ToLower(); //This allows you to get the type of file
                   
                    if (type == ".exe" || tipo == ".rar" || tipo == ".zip" || tipo == ".tar") //Just to filter the type I want to allow
                    {
                        try
                        {

                            string path = Server.MapPath("MyFolder"); //This is the name of my path (Located on the appfolder/MyFolder)
                   //getDataString is a custom method which returns the actual date as 20_01_2007_01_01_23 (substitutes the "/" for "_"to concatenate on                    //the file name to save

                    string fileUp = "_dwnlds_"+ getDataString(); //The name of my file

                            ficheiroUpload.PostedFile.SaveAs(path + "\\" +fileUp + type); //Save the file on the directory with the extension

                            file = fileUp + type; //Just a string, to save on my DB


                        }
                        catch (Exception ex) { warningLabel.Text = ex.ToString(); } //Warn the user of an error
                    }
                    else
                    {
                        n++; //Just a flag for me
                    }
                }
}

 

Is you noticed this refers to a download page, so I call the file as dwnlds, and concatenate the date and time, to keep it like this:

_dwnlds_23_03_3007_13_30_23.pdf

 

This way you can save surely dynamic different file names, and is harder for the user to type the file URL by hand on the browser. Use the tip!This time, hope it really helps!!!Anything don't hesitate! 


Best regards,
David Ribeiro
0
dvd
3/24/2007 6:47:34 PM
JoshStodola:

I can't see any worthwhile reason to not use the FileUpload control, but.....

http://www.aspfree.com/c/a/.NET/HTTP-File-Upload-without-User-Interaction-using-dot-NET/

Hope this helps!



Because you are limited by various IIS settings, adjustment of which can muck with your session behavior(expiration, request timeouts) and all sorts of things.  Just for kicks, try uploading a file locally over 4mb to localhost and watch it fail.  There's no pretty solution floating around that is secure that doesn't involve a download to the client, which most folks can't do.  That's why there are Java solutions, because most users don't have it restricted.
Does your team use the VSIP toolkit or maybe have the bulk of your app factored down to patterns and generators? Do you need in-house controls that will make your current vendors blush? If so, we need to talk.
0
Jonathan
3/24/2007 10:06:35 PM
Jonathon, first of all I would never allow for the upload of anything over 4MB anyways.  And if I needed to, I could change the maxRequestLength in web.config very easily.
Josh Stodola ← Come check out my blog!
0
JoshStodola
3/24/2007 10:28:22 PM
Reply:

Similar Artilces:

without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible?
without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? avdp211:without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? I don't think it is possible.You use the the HTML input file control and when you post the request, on the web server you need to read the data and save it to a file, so there has to be some interaction with the server to handle the post request.  Not possible vi...

Uploading Files without using File control
Hi Everyone, I'm in need of a feature where i need to upload a file without using File control. Anyone have pointers to go about it ? I've already gone through this tutorial: http://www.15seconds.com/issue/010522.htmbut when i try to run the code it gives me the error on window 2000 PC:"Safety settings on this computer prohibit accessing a data source on another domain."even though security setting set to "Low". And on XP machine i get the error:"Can't create automation server" (or something like that not entirely sure)My actual requirement is to upload a file using AJAX.Help will be gr...

File Upload: Without using File Input control
Can anybody just tell me how to store a single file from client machine on to server without using a HTML File Input Control. Regards, Kiran You can use the FileUpload control, but that just renders an HTML file input control in the end.  If you don't want to use any HTML stuff, you could use an ActiveX control.  There are plenty available by searching.Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! I tried to find from your serach string but I could not find the exact code in Asp.Net. Can you Please send me&nbs...

How to upload file without using html file control
hi i want to know how to upload files without using <input type=file ... > control.means without browsing and selecting the file. i know due to security issues its not allowed that we assign value to file control. but there must be some way of doing it. i heard this can be done using  "HTTP POST" ?  or by opening a socket conenction with the web server? please help  Irfan Zafar Using HTTP POST requires that you use a form and, therefore, use a HtmlInputFile Control. Obviously this isn't what you want to do. The only solution is to write an ActiveX Contr...

How to identify the original file type and restrict the file uploading while using file upload control
 Hi asp.net , I am uploading a file using FileUpload control in asp.net using vb.net.I wrote the code to upload only PDF files. the user can change the extension and change to PDF . I have to check is the file original PDF or not then i have to upload the PDF files only . How to do this ??  Hi, Check the file Mime type for "application/pdf" by looking at the:  FileUpload1.PostedFile.ContentType RegardsSmcoxonNo Gem is ever polished without some friction. Hi smcoxon , Thanks For Replying ,But i found that there is no use using PostedFil...

How to upload file without using file control in 1.1?
I saw several examples of file control.  Works great!  But I am looking to incorporate this in a webservice that will receive the path parameter and upload the file. Is this possible using 1.1 code? Hi, not directly. You still need to upload the file to your webform but instead of saving it you pass it to the generated proxy of the webservice as a byte array (byte[]) parameter. Grz, Kris.Read my blog. Handy Firefox plugins for web developers. Anyways, How can i read a files Byte[] - the file that exists on the client without uploading to the server? Hi, nimish:How can i ...

How can Upload file without using input (file) control
I want to save image in the database from client PC. I use ASP.NET 1.1, Using C#, sql server 2000.  I took a hidden field (picHidden) and store filePath in it. Input (file) control is not allowed b/c I took the image using Web Cam in an Image Web Control. I did by it using the following code   FileStream fs = new FileStream(picHidden.Value,FileMode.Open, FileAccess.Read); byte[] ImageData = new byte[fs.Length]; fs.Read(ImageData,0,Convert.ToInt16 (fs.Length)); emp.UpdateEmployeepic(this.sEmpId, ImageData);   The problem is, my code work fine when I run...

Upload multiple files to the server without using File Upload
I want to upload multiple files to the server without using input type file (File Upload). Is there a way to do this. What I want to do is retrieve multiple file paths (paths are displayed in a user control like text boxes) and upload those files to the server as a bunch. I tried to set the value of the File Upload cotrol (using javascript) but it was not succeed since attributes of the File Upload are readonly. (document.getElementById("fileUploadValue").value = "C:\Test.txt") Is there a way to override the values in File Upload control or is there a way to up...

Add link buttons to each file uploaded using File upload control
Hi,   In my application I have one file upload control. When the user selectes a file to upload and when he clicks on Attach button I need to show him the file name of the file he selected to upload and also show the Remove link button after the file name. In this case I need to generate link button dynamically. I wrote a code like the following:protected void btnAttach_ServerClick(object sender, EventArgs e) {string strFileName = MyFile.PostedFile.FileName;string c = System.IO.Path.GetFileName(strFileName); listBoxAttachedFiles.Items.Add(c);LinkButton b = new LinkButton(); b.Te...

Is there any limitation of file types that file upload control can be used to upload?
I am working on a content management system which requires me to upload WebEx recording files (.wrf) through file upload control. But I am getting "internet explorer cannot display the webpage" error. It worked with other files types as txt, doc, xls, pdf, jpg, gif etc. Is it related to any security issue or just a bug with the file upload control?  Thank you. The file upload control doesn't have any file type limitations that I'm aware of, but it does have some size constraints.  By default, ASP.NET is configured to not accept any file's larger than 4...

file uploader save file on server and in database and upload this file on client
hi,i have a file uploader control user can attach files (.rar, .zip, etc) and store file folder and path in database. and another user can click of attach link and can download that file. how can i do this please solve out this problem. you can find your problem solution in this link and you can store the file name in your database server.http://www.aspnettutorials.com/tutorials/network/net-fileupload-aspnet2-csharp.aspxPlease Mark as Answred If This Blog has Helped You.RegardsMitesh Darjihttp://www.indianic.comhttp://www.mitatdotnet.blogspot.com As always there are many ways and which ...

Upload file withouit using the file control
hi is there a way to upload files withouit using the  file control Not that I know of. I would require some kind of component to be installed Client Side (ActiveX etc.). Read this article for more information.RegardsAndre Colbiornsen ---------------------------------Seventh DayRåbygatan 1A,SE-223 61 LundSwedenMob.: +46-(0)708-97 78 79Mail: info@seventhday.se--------------------------------...

Posting filepath in file upload control in .NET to the next page and uploading the file from second page
In our application (using C# .NET) there is a form with file upload options. After filling up the form details, the summary of the details need to be shown in the next page before committing the information into the database. Right now, Server.Control is used to transfer the contents to the next page and the form details are retrieved using Request.Form["control id"]. But this is not working for File upload control alone.File upload can not be done in the first page itself, as the foreign key in File upload table gets updated only in second page after confirmation. Therefore, is th...

File Upload control, file loads in VS2008 and server browser, file fails load from client browser across LAN
Win2008 Standard with IIS7.0. VS2008 website project with grid and upload control in form template.  File upload control loads image file to database blob column for display by grid. Using Windows authentication for an intranet application. Image file uploads to the database blob without errors in VS2008 test environment and from the Win2008 server IE7 browser. Image file does not upload (falls through to CATCH for file not loaded) when file is selected from client IE7browser on LAN or WAN. I suspect the problem is then with security setup of IIS 7.0 and/or web.config. Unable to f...

Web resources about - How to upload file without using file control...??? - asp.net.client-side

Harrison Ford needles Trump for 'Air Force One' praise
Footage of actor Harrison Ford reacting to praise by Republican White House hopeful Donald Trump for his patriotic performance in the film "Air ...

Google app for iOS gets 3D Touch and multitasking
Google has updated its iOS app to include three new features, two of which are not available to Android users. First, the company has integrated ...

New Stars Wars toy leaks early, Lucasfilm tries to remove it from the Internet
The long tentacles of Lucasfilm's Intellectual Property arm are pretty much impossible to avoid, a fact a couple of Star Wars fans from Iowa ...

Rift Emerges Between Rich Nations, Others at Climate Talks
Washington Post Rift Emerges Between Rich Nations, Others at Climate Talks New York Times LE BOURGET, France — With only hours left to produce ...

Trudeau’s Canada, Again
O n Tuesday , Nov. 10, six days after Justin Trudeau, leader of the Liberal Party, was sworn in as prime minister of Canada, I was shown into ...

DraftKings and FanDuel stay alive in New York after emergency ruling
DraftKings and FanDuel have averted disaster for now. Hours after one judge ordered the daily fantasy sports sites to cease operations in New ...

Report: San Bernardino gunman's pal spoke of "sleeper cells"
CBS News Report: San Bernardino gunman's pal spoke of "sleeper cells" CBS News A friend of one of the San Bernardino attackers spoke about ...

US stocks sink as Dow Chem, DuPont drop after merger deal
New York (AFP) - US stocks fell more than one percent to continue a global sell-off Friday, with investors selling down industrial heavyweights ...

Bryan Singer Breaks Down the ‘X-Men: Apocalypse’ Trailer
The X-Men: Apocalypse trailer hit the web today, and based on the 200 comments left on that post , it’s fair to say the response has been mixed ...

Chinese e-commerce giant Alibaba acquires South China Morning Post
Perhaps Jeff Bezos started a trend two years ago when the Amazon founder acquired the Washington Post. Chinese e-commerce giant Alibaba announced ...

Resources last updated: 12/11/2015 11:44:50 PM