Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0<identity impersonate ="true">
Previous
 
Next
New Post
11/20/2006 4:20 PM
 
 

I have a DNN 4 module that works on my local machine.  This module has been loaded on a DNN 4 installation on another server.  It works fine on that server.

I have added many more functions and code to this module and successfully uploaded the module to the DNN4 installation on the other server.

I have added new code that does not work!  I am trying to upload/copy an "xml" file from any of my drives to the /portals folder.  It works fine on my localhost.  But when I run it from the remote server I getting the following error message:

A critical error has occurred.
Could not find a part of the path 'C:\DNNAssessment\Website\DesktopModules\MIMH.DNNAssessment\eHealthLiteracyScale.xml'.

Basically I am using the <input id="cmdBrowse" ...> to upload this file

I am including part of the settings.ascx user control where this code is found:

<tr>
    <td class="SubHead" width="150">
        <dnn:Label ID="lblUploadAssessment" runat="server" ControlName="AddNewAssessment" Text="Add: " />
    </td>
    <td valign="bottom" width="480">
         <input id="cmdBrowse" type="file" size="40" name="cmdBrowse" runat="server">&nbsp;&nbsp;
         <asp:LinkButton ID="cmdUpload" resourcekey="cmdAdd" runat="server" CssClass="CommandButton" class="CommandButton" Text="Add" BorderStyle="none" />
    </td>
</tr>

the code the works on the localhost but fails on the remote server.  This code is taken from my cmdUpLoad_Click() from settings.ascx.vb:

Protected Sub cmdUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdUpload.Click

If Page.IsPostBack Then
    Dim strFile As String = cmdBrowse.PostedFile.FileName

    If strFile <> "" Then
        Dim assessmentController As New MIMHAssessmentController
        Dim assessment As MIMHassessment = assessmentController.GetMIMHAssessmentSession()
        Dim strErrMsg As String = ""
        Dim bolInvalid As Boolean = True

        With assessment
                 If assessmentController.IsAssessmentFile(strFile, .RootName, .XMLSchemaFile) Then
                    strErrMsg = "Valid Assessment file!"
                    bolInvalid = False
                    Call Me.AddAssessment(strFile)
                 Else
                    strErrMsg = Path.GetFileName(strFile) & " is an invalid Assessment file!"
                 End If
                 If bolInvalid Then
                    
Me.txtErrMsg.Text = strErrMsg
                     Me.txtErrMsg.Visible = True
                 End If
        End With
     End If
  End If
End Sub

The IsAssessmentFile() function tries to load the "xml" file to see if it is in a certain format

...
xmlDataDoc.Load(strFile)

This is where I get the error.  It says it could not find the part of the path of the file. 

Like I said, it works fine on the localhost, but not on the remote server.  The remote server has been running this module fine for a while -- (ASPNET) user seems like it has the proper premissions.

I even tried to set <identity impersonate="true"/> in the web.config.  And I still get the error.  It seems like some kind of permission problem.

I want to be able to upload a file to the remote server from any of my valid drives.

I appreciate any help.

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0<identity impersonate ="true">


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out