3

I'm using Filereference.save() to save a XML file. It's working fine with default filename.But is there a way to force a file extension on the saved file? I'm using "untitled.xml" as the default filename, but if the user changes it to say "myfile", it gets saved as "myfile", rather than "myfile.xml".

1 Answer 1

2

No, you can't. For loading, you can use type filters, but for writing you cannot.

One reason may be security. Many users use the default view of icons in windows, which omits extensions. Thus you could save "myfile.xml.exe" and put malicious binary code into it. But I am just guessing.

greetz
back2dos

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.