By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

how to know where the file has been saved using a document.execCommand(saveAs).

P: 6
hi all,

i have a question related to document.execCommand(saveAs).

i need to know the path of the file selected by the user in the saveAs dialog box.
i need to make some changes to the saved file.

if not a direct way is there any work around way to find the location of the file saved?
Jan 28 '08 #1
Share this Question
Share on Google+
7 Replies


P: 6
hi all,

i want to know if there is any to open a saveAs dialog without using execCommand.

my problem is that i want to create file(on his hard disk) with the name the user has entered in a text box and write some data to it.

problems i faced
1. i dont know the path where he has saved the file (if i use execCommand.)
2. even if a file is created , the html is saved in it.

so, if i know where the file is saved i can change its contents or if there is some other method by which i can do it.


please help....
Jan 28 '08 #2

acoder
Expert Mod 15k+
P: 16,027
Supply the full path as the third parameter to execCommand - see this link.
Jan 28 '08 #3

acoder
Expert Mod 15k+
P: 16,027
i want to know if there is any to open a saveAs dialog without using execCommand.
I've merged the two threads. See the link in the previous post. Please note though that "saveas" is only supported in IE.
Jan 28 '08 #4

P: 6
Supply the full path as the third parameter to execCommand - see this link.

my question is not that. i want to allow the user to choose the location. i want to leave it to him where he want to store it. but if i know the location where he had stored it i can update it or so.

for that i need to know where he stored it.

so, my question is how to know the path/location which the user had choosen.

hope i am clear now.

awaiting a quick reply.
Jan 29 '08 #5

acoder
Expert Mod 15k+
P: 16,027
I don't think that's possible. You could look into a vbscript/ActiveX solution, e.g. using FileSystemObject.
Jan 29 '08 #6

P: 6
I don't think that's possible. You could look into a vbscript/ActiveX solution, e.g. using FileSystemObject.
but by using filesystemobject will we be able to popup a save as dialog ?

can u let me know how to use it?

or can we create any object of a saveAs dialog box so that we can use something like object.[method] so that we can have access to the path?
Jan 29 '08 #7

acoder
Expert Mod 15k+
P: 16,027
I'm not really sure if you can popup a save as dialog using FSO.

Why not just make the changes before writing the file? Then there would be no need to modify the file and figure out where the file was saved.
Jan 29 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.