How can i make a custom file explorer with an HTA application? - hta

I want to make a custom file explorer to go through the files and folders like you would with the normal window explorer. I want it to have the same basic function like being able to go folder to folder and back up to the previous folders and be able to open and execute files and such. How can i do this? Can anyone help get me started?

Are you sure HTA still runs? I thought it was killed of by various security enhancements? Assuming a HTA runs Javascript OK, here are some javascript libraries that have interactive file tree functionality:
http://john-smith-js.com/filetree.html
http://dhtmlx.com/docs/products/dhtmlxTree/
Post back if you would like to continue down this path.

Related

Running ASP file directly on your browser without typing into url

I'm currently new to asp.
I have just started running ASP file and the problem is every time I run an ASP file I have to enter the Path through url in browser.
example : http://localhost/MyWeb/test.asp
Is there any quick way of testing the ASP pages on browser.
I have created a Test server in Adobe Dreamweaver and able to run ASP pages via Dreamweaver.
But I want to run ASP files just by double Clicking on it.
Is there any way to do that.
Thanks in advance.
What you ask for is not directly possible.
What you can do is write a batch file, call it for example "DisplayPage.bat" and with such code:
set str=%1
set str=%str:C:\inetpub\wwwroot=http://localhost/MyWeb%
set str=%str:\=/%
start IEXPLORE.EXE %str%
REM pause
This is assuming your root web folder is "C:\inetpub\wwwroot" if not change to your root folder path.
Now having this follow these steps:
Right click any .asp file and choose "Open with"
In the menu select "Choose default program..."
Browse to the batch file you created above and confirm. Tick the "Always use the selected program to run this kind of file" to make it permanent.
This will cause double clicking to open the clicked file in Internet Explorer, pointing to localhost.
The above steps are for Windows 7 but can be achieved easily for any OS.
If something goes wrong with the process you can remove the "REM" from the last line so the batch file pause and show what went wrong.
You can use includes
there are two types of includes File and Virtual read more at http://www.w3schools.com/asp/asp_incfiles.asp

How do I allow the user to select the path for a file?

In an application I'm working on, the users are prompted for the path of a file. This path will always point to a network drive, which the server has access to.
Currently, we use an asp:FileUpload control to accomplish this, drawing the path from the FileUpload's PostedFile.FileName property.
The problem is that the files the user is selecting from are locked down pretty severely. While the server has full access to them, the user only has permission to view the directory contents... They can't even open the files. This has worked fine up until now... But Windows 7 won't display these files in the file picker generated by FileUpload, so we need an alternative.
Notes:
Looking for a way to get UI similar to the file open dialog already in place.
The ability to view the client's local files (including the shared network drives) is a bonus, although listing the files through the server is acceptable.
I think the problem is the permissions on these files. If the users can't even open them, how can their terminal possibly upload them to a website?
I'm surprised this has ever worked.
If the user is simply supplying a path and not actually uploading the file you could have the server display the contents of the folder (in a list or whatever) and the user selects from that.
So how about creating a file browser in a window, such that a user clicks "Pick File" which opens a new window showing the root contents of the network drive. The user can then navigate round the directories to the file they want, finally clicking the file to "upload".
Use System.IO Directory.GetFiles to get the files in a directory.
I think you need to separate out the two things. Here's an example prompt to convey the idea:
Select a (file from your computer) OR (file from the server)
Client Files
You can use the standard file-upload control, that is fine.
Server Files
No user should be selecting files from your sever with the upload-file dialog. (Keep in mind that these dialog boxes allow right-click menus delete, copy, properties, etc and locked down or not, the user should not think they have this ability).
I don't think there are any controls that will "do-it-all" for you in this manner. I think your best bet is to make your own interface here.

Uploaded pictures not included in project

I have upload control on my asp.net page. I upload pictures in folder cars and they show in windows explorer when I open that folder (cars), but in Visual Sudio they act like they not include in project ( that is the reason why they don't show on image control which point to some of them. What did I make wrong ?
Uploading the images in the web application will never make any changes to your project. You will have to add them manually if you'll need them there. But generally these are pictures added by your user so the would just be in the file system - not really part of the solution, are they?
If you have choosen a webSITE then it will allow this, but not if a webPROJECT is selected.
I didn't find this on net, but I had two projects, and the one which was allowing me to show uploaded files was a website.
You have to click the refresh button at the top of the solution explorer in Visual Studio for it to show changes to the files.
You have to click Refresh button. Also ensure that "Show all files" icon is selected. And finally, you will have to right click on the files and select Include in Project. That way it would become part of your project.
If I may ask, what exactly are you trying to achieve in your application? The reason I ask is, if there is an upload happening in your application, you shouldn't need to include the files in your project to refer to it from code.

Handling file uploads in Drupal

I've been messing around a bit with various solutions to what I would see as a fairly common problem, but I've not yet been able to solve it in a satisfactory way.
What I wish to achieve is some kind of functionality where a user can upload new files, or select existing files to reuse them.
What I've been using so far is a combination of the filefield, filefield_sources, imce and ckeditor modules. I guess ckeditor isn't really important for the solution, but I need to be able to embed images from the archive somehow, and this is done with IMCE . Since I do not want everything to be accessible from the filebrowser I created a subdirectory and set full access to it in the IMCE settings, lets call it default/files/site
This worked fine as long as all filehanding was done through IMCE, but when I uploaded files directly from the filefield my files ended up in the default/files root, so I set up folders for my fields, for example default/files/site/movies in a field that allowed the .flv format. This worked fine to, as long as I didn't try to access the files through IMCE. It appears the folders created by filefield are not accessible from IMCE?
I'm also in a position where I need to support large uploads (200MB+), but from my experience in other projects, allowing file uploads through FTP is usually a life-saver, but from what I understand IMCE won't support files not uploaded through Drupal in some way, since they are not present in the database (giving the message: The selected file could not be used because the file does not exist in the database.)
I'm aware that I don't really have a clear question to my problem, but somehow I need to figure this out pretty fast. How would I preferably solve this? I'm aware that I'm not the first to have this problem, but I have not yet been able to find a nice and stable solution. What am I missing?
Also check this thread (http://drupal.org/node/438940) and the reference to John Locke's work at: http://www.freelock.com/blog/john-locke/2010-02/using-file-field-imported-files-drupal-drush-rescue
Well, I'm not personally familiar with IMCE off of the top of my head, but if you need files that have been uploaded via ftp to be added to the files tables, then my impulse would be to write a small module which would then allow the user to click a button and start off a batch process. (This is me assuming that you are using Drupal 6, as the batch api doesn't exist in 5.)
Said batch process would then iterate over all of the files in the appropriate directory, which I would assume you had uploaded the files to, use file_copy() (from Drupal's file API) to copy the files to default/files/site, and then would add said files to the files table, which is actually quite simple with drupal_write_record().
It might not even need to use the batch api - it somewhat matters if you're just uploading 10-30 really big files, or 200-300 MB files.
For using the batch api, I'd look at http://drupal.org/node/180528 - this has a fairly basic example of how the batch api works, which basically consists of telling the api that you want to keep calling function_a, and then inside of function_a setting your progress in the context array until you're done, at which time the batch process finishes. Then you just have whoever uploads the files via ftp to hit a button on the website to move and register the files.

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