Received : 2007/12/13 14:17:42
Message : Hi, I have problems with Aspose.Words running on server.
Here is my code:
=============================================
Sub DoWord(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim strValue As String strValue = "
Some Text
"
Dim doc As Document = New Document()
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
builder.InsertHtml(strValue)
doc.Save(“test.doc”, SaveFormat.Doc, SaveType.OpenInBrowser, Response)
End Sub
=============================================
If I press the button to generate the word file I get the error message that I could not download the file. The internetsite could not be opened. It is either not available or could not be found.
What did I wrong?
On localhost it works fine!!
Thanks for an answer.
Kindly regards, Andreas (from Germany)
Thanks for your request. Your code is correct and it should work fine. Maybe problem is in security settings. Can you download anything from this site? You can try using the following code for testing.
Dim bytes As Byte() = System.IO.File.ReadAllBytes(Server.MapPath(“test.doc”))
thanks for the answer. I bind the aspose word component in an user control (ascx). I tried to inherit it in a normal aspx site and now it works!! Thanks for the help.
But now I have a problem with the aspose pdf component. And again it works on localhost machine but not running on web server. The code line “doc.Save(stream, SaveFormat.AsposePdf)” causes the general error page of .NET.
Here is the code:
Sub CreatePDFFile()
Dim doc As Document = New Document()
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
I gave writing rights to the folder in which is the site with the pdf component. Is it possible that there’s full trust necessary? Our web hoster only offers medium trust level.