1

I looked around and I can't seem to find the answer I need. Is there a way to select the location of a folder in an HTML input? I looked at this post but the answer is uploading the files in the selected folder.

I am trying to create something where the user can choose an output folder on his/her computer where files will be downloaded to. So I need something where the user can browse his/her computer, select a folder, and the location string ("C://...") will show up on the input text box.

Please let me know. Thanks!

1
  • Try to use the input type="file" Commented Oct 14, 2014 at 17:53

1 Answer 1

1

No on clientside with plain html and javascript it isn't possible. Your browser handle file downloads. So you can only specify download location in the browser settings!

There are solutions for IE and Chrome but this is very browser specific:

For chrome you can use FSO.js, which is a JavaScript library for temporary and permanent client-side file storage.

In IE you can create an ActiveXObject like this:

// initialize ActiveXObject and create an object of Scripting.FileSystemObject.  
var fso = new ActiveXObject("Scripting.FileSystemObject");  

// creates a folder with specified name at the specified location  
fso.CreateFolder("C:\\Temp\\myFolder");  

fso = null; 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.