Hello!
I have simplified the test and tried this:
Sub Test1()
Dim doc As Document = New Document()
doc.Save(“This Is My File.doc”)
End Sub
The code saves “This Is My File.doc” as it is specified. Are you sure your string variable contains proper file name? There could be some special character we don’t see in debugger which gives such a behavior. Please provide more information to reproduce the issue. Also note that it is not related to Aspose.Words itself.
Regards,
I already verified this works as well. The issue here is that the document is saved for downloading to a client, that is the reason it uses the overloaded save method.
When the document name is converted to a part of the URL spaces are not allowed. In URLs space characters should be escaped with special sequence: %20. Just try the same but substituting spaces in file name with this sequence. Browsers will recognize this and show the original name.
Regards,
Hi
I think that you can try using the following code to solve your problem.
string fileName = “out1 test.doc”;
if (Request.Browser.Browser.ToString().ToUpper() == “IE” && Request.Browser.MajorVersion >= 7)
fileName = fileName.Replace(" “, “%20”);
doc.Save(”"" + fileName + “”", SaveFormat.Doc, SaveType.OpenInWord, Response);
I hope that this will help you.
Best regards.