Asp.net : Upload directory using c# - asp.net

I have have a solution now to upload multiple files using (drag drop) technique by JavaScript and jQuery, but I need to find a way to upload folder with all of it is content like Google drive . Is this possible?

Unfortunately you can not do this, only with a browser.
You will have to use a custom client for this.
But a simple method will be Ask the user to ZIP the folder and upload the zip using the file-upload control.
Then on the server end, you can un-zip and read the content.

Related

Is there a place to temporarily hold code?

I am currently using webflow to design a site and want to add custom code that requires an upload of an ajax data txt file. I'd like to externally link the file, I'd normally upload to a personal hosting account, but I don't have one at the moment. So I am looking for a place to upload the txt file to and when you open it opens something like this jQuery CDN
IS there such a facility available? I don't need the file to be there long, just for a few hours for testing.

Wordpress File Upload Hook

I am trying to hook into the Wordpress file uploader and would like some suggestions. I would like to be able to grab the path of the source file (not WP path; i.e. K:\docs\file.pdf) so I can download another file of the same name (different extension) & path automatically (i.e. K:\docs\file.txt).
Wordpress provides hooks for after the file is uploaded but all path information at that point is internal to wordpress.
Thanks in advance!!
the path information can be obtained from normal php functions like pathinfo() and realpath() for example .
Bit too late to the party but I think what you are asking for is to find the source of the document in the clients system and based on that you want similar files there to be picked up by the browser and then sent to the user.
I think it will be a fairly complex thing to do, firstly you have to get the source of the document being added to the browser (I am not sure it can be done, but if it can be done then it will be via javascript) and then upload all the files one by one to the server hosting wordpress and you can do this by creating a custom page which will add the files uploaded to it as a wordpress attachment and then using something like jquery file uploader to upload files to that location.
But honestly, I think it would be a very complex thing, unless the client and the server are on the same machine.

File browser control to replace <input type="file">

I'm working on an ASP.NET web application for our corporate intranet users. I have a form where a user should provide a path to the file on the local network (something like "\localServer\someFolder\someFile.ext") without uploading the actual file. The issue is that users don't want to type the whole file path and want to use some kind of visual browse dialog.
The standard HTML <input type=file> element allows to browse for a file, but most of the browsers (except for IE) don't allow to access file's full path, so I think it should be done by some external component like Silverlight, Flash, Java applet etc.
I tried to do it with Silverlight, but I'm getting a SecurityException when trying to access file's full path using Silverlight's OpenFileDialog class.
This java applet http://jumploader.com/demo_images.html seems to do something similar to what I'm looking for, but it's focused on uploading files - I only need to be able to get file's full path and pass it to the server as a string.
Any suggestions would be appreciated.
Telerik ASP.NET AJAX RadFileExplorer has the functionality you're looking for:
http://www.telerik.com/products/aspnet-ajax/fileexplorer.aspx
You can use their Custom File Content Provider to hook the GUI to your server's file system.
http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/dbfilebrowsercontentprovider/defaultcs.aspx
This should be possible with Flash's uploading capabilities. SWFUpload has an API that you may be able to access from JavaScript to extract the selected file name without actually uploading anything. See docs here, for example getFile():
getFile is used to retrieve a File Object from the queue. The file retrieved by passing in a file id (the id property from a file object) or a file index (the index property from a file object).

How to upload a file in asp.net without reloading a page

How to upload a file in asp.net without reloading a page
You will need to perform asynchronous
file upload using Ajax and send the
file in chunks of bytes.
Authentic AsyncUpload in original AjaxConotrlToolkit
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx
Some other references that may interest you..
Matt berseth's Asyncupload <-- Recommended
SWFUpload
FileUp
Flajaxian FileUploader
RadUpload
NeatUpload
ASP.Net File Upload/Download Module <-- Recommended
You should find a suitable ajax uploader. One wise choice would be a jquery ajax uploader. I hope this jquery ajax uploader, free download, would win your heart. All the best!
There are many ways to do this. but if you need some extended functionality try this sample.
Here is a cross-browser script to upload file using ajax. You can search google for Ajax file upload and find out other tools and techniques if this one does not works for you.
jquery-transmit is a sophisticated jQuery plugin providing an elegant multi-file upload utility. At the core of the plugin is a small SWF file which provides single or multiple file selection and upload services
try this
it uses jquery to upload multiple files... you can also download sample project which works fine.. and uploads files quickly.
you may need to change your web.config to set lenght of data can be passed ... in the sample project...

ASP.NET File uploading-dynamic file names

I have a web page where i have an ASP.NET file upload control to upload files from client machine to Server.Now i want to do the uploading n number of times.Ex : I want to upload 100 files from my local pc to server.The 100 file names i can read from an excel file in my program.But is there any way to assign this file to the file upload control ?
No, as a security feature, FilUpload controls do not allow you to set what to download (imagine if you sign on to a website, and it is set to upload a passwords file or something).
Now there is probably another control, or a way to code around this, buut the FileUpload control will not allow it.
I would recommend using the jQuery Multifile Uploader which would take care of a UI (if you need one). And the actual uploads with Free ASP Uploads which takes care of the actual file transfer. Though it sounds like you are tkaing care of the programs programatically, so you can skip the multifule and just work with free asp upload.
You'll have to make your own Flash object or something to accomplish this, the basic HTML/ASP.Net controls won't let you do what you're looking for.
This will require creating some kind of an active or installable control. In order to get around the security hole of doing this, you're ultimately going to have to be able to execute code on the machine to select and upload the file.
And at that point, you're platform specific, so...
I would strongly suggest that instead of trying to have a web site automatically upload files for you, that you make a WinForms utility to accomplish this task and upload the files wherever you need, communicate with the web site over web services, etc.
This is a security restriction, you cant script the file selection of an upload box as it would allow hackers to write scripts to steal files off your computer.
You could use this silverlight upload utility which is my list of "things to use when I get the chance".
It has a nice UI and supports uploading many files at once. I originally tracked it down doing some research for a photography website that we were quoting for but that project fell through.
Anyway the project can be found here:
http://www.michielpost.nl/Silverlight/MultiFileUploader/
It also has full source code included so even if the control's developers abandon it you still have the choice to edit it yourself.

Resources