Free Support Forum - aspose.com

Problems with document save on production server

I'm using Aspose Words and it works on my local machine and my development server.

But, when I do a doc.Save on the production server, instead of trying to download my document, it asks if I want to save "default_aspx" and then gives a "Cannot download that document" error message.


This message was posted using Aspose.Live 2 Forum

Hi

Thanks for your inquiry. Please provide me your code.

Try using this method.

doc.Save("Report.doc", SaveFormat.Doc, SaveType.OpenInWord, Response);

Also please check your permissions on production server.

Best regards.

My event handler follows. I know it's finding the license and merge document and making it to the doc.Save line. As you can see, I'm already using the form of the Save method you suggested.

Now, the part about permissions is more interesting. I have given full read/write permissions for my entire website to the "Network Services" user. Anything else I need?

BTW: The production server uses SSL.

Private Sub cmdReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReport.Click

Dim oReportsCont As New ReportsController

Try

Dim oReportsInfo As ReportsInfo = oReportsCont.ReportsGet(CInt(cboReportType.SelectedValue))

Dim sRptPath As String = DotNetNuke.Common.Globals.ApplicationPath + REPORT_ROOT

Dim license As license = New license

license.SetLicense(Server.MapPath(sRptPath + "Aspose.Words.lic"))

Dim doc As Document = New Document(Server.MapPath(sRptPath + oReportsInfo.ReportLocation))

Dim builder As DocumentBuilder = New DocumentBuilder(doc)

Dim bookmarks As bookmarks = doc.Range.Bookmarks

Dim bookmark As bookmark

Dim iFacultyID As Integer = 0

If cboFaculty.Visible Then

iFacultyID = CInt(cboFaculty.SelectedValue)

End If

For Each bookmark In bookmarks

'builder.MoveToBookmark(bookmark.Name)

'builder.Font.Bold = True

'builder.Font.Color = System.Drawing.Color.Red

'builder.Write(bookmark.Name)

Select Case bookmark.Name

Case "FacultyName"

builder.MoveToBookmark("FacultyName")

builder.Font.Bold = True

builder.Write(cboFaculty.SelectedItem.Text)

' Faculty Review Bookmarks

Case "FacultyInfo"

AddFacultyInfo(builder, iFacultyID)

Case "StudySections"

AddStudySectionInfo(builder, iFacultyID)

Case "Grants"

AddGrantInfo(builder, iFacultyID)

Case "ClinicalActivities"

AddClinicalActivitiesInfo(builder, iFacultyID)

Case "Students"

AddStudentInfo(builder, iFacultyID)

Case "Recruits"

AddRecruitInfo(builder, iFacultyID)

Case "Departures"

AddDepartureInfo(builder, iFacultyID)

Case "Collaborations"

AddCollaborationInfo(builder, iFacultyID)

Case "Relationships"

AddRelationshipInfo(builder, iFacultyID)

Case "Editorships"

AddEditorshipInfo(builder, iFacultyID)

Case "Honors"

AddHonorInfo(builder, iFacultyID)

Case "Lectureships"

AddLectureshipInfo(builder, iFacultyID)

Case "Affiliations"

AddAffiliationInfo(builder, iFacultyID)

Case "Committees"

AddCommitteeInfo(builder, iFacultyID)

Case "Teachings"

AddTeachingInfo(builder, iFacultyID)

Case "Residents"

AddResidentInfo(builder, iFacultyID)

Case "ClinicalFellows"

AddClinicalFellowInfo(builder, iFacultyID)

Case "PostdoctoralFellows"

AddPostdoctoralFellowInfo(builder, iFacultyID)

Case "Presentations"

AddPresentationInfo(builder, iFacultyID)

Case "Publications"

AddPublicationInfo(builder, iFacultyID)

Case "Books"

AddBookInfo(builder, iFacultyID)

'Annual Report Bookmarks

Case "FacultyResearchInterests"

AddResearchInterestList(builder)

Case "StudySectionsList"

AddStudySectionsList(builder)

Case "PublicHealthServiceGrantList", "FederalGrantList", "LocalGrantList", "SocietyGrantList", "IndustryGrantList", "VAMCGrantList"

AddGrantsList(builder, bookmark.Name)

Case "GraduateResearchersList"

AddGraduateStudentsList(builder, True)

Case "NewRecruitsList"

AddNewRecruitsList(builder)

Case "IntramuralCollaborationsList", "ExtramuralCollaborationsList"

AddCollaborationsList(builder, bookmark.Name)

Case "RelationshipsList"

AddRelationshipsList(builder)

Case "EditorshipsHonorsEtcList"

AddEditorshipsHonorsEtcList(builder)

Case "TeachingHonorsList"

AddTeachingHonorsList(builder)

Case "UPMCResidentsList"

AddResidentsList(builder, False)

Case "OtherResidentsList"

AddResidentsList(builder, True)

Case "ClinicalFellowsList"

AddClinicalFellowsList(builder)

Case "PostdoctoralFellowsList"

AddPostdoctoralFellowsList(builder)

Case "GraduateStudentsList"

AddGraduateStudentsList(builder, False)

Case "FacultyTeachingList"

AddFacultyTeachingList(builder)

Case "InvitedPresentations"

AddInvitedPresentationsList(builder)

Case "ResearchFacultyList"

AddFacultyList(builder, True)

Case "ClinicalFacultyList"

AddFacultyList(builder, False)

Case "FacultyPublications"

AddPublicationsList(builder)

Case "FacultyChapters"

AddBookChaptersList(builder)

End Select

Next

doc.Save(oReportsInfo.ReportLocation, SaveFormat.Doc, SaveType.OpenInWord, Response)

Catch Ex As Exception

ProcessModuleLoadException(Me, Ex)

End Try

End Sub

Hi

Thanks for additional information. I found this article. Maybe this could be useful in your case.
http://support.microsoft.com/kb/317208

Hope this helps.

Best regards.

Found the answer!

After reading this thread on another forum:

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/18/threadid/71140/scope/posts/Default.aspx

I changed my save call to:

...

Response.ClearHeaders()

doc.Save(oReportsInfo.ReportLocation, SaveFormat.Doc, SaveType.OpenInWord, Response)

...

and it works now. You may wish to update your code.