1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

problem with server.MapPath

Discussion in 'Plesk 11.x for Windows' started by samiakh, Nov 25, 2012.

  1. samiakh

    samiakh New Pleskian

    10
     
    Joined:
    Oct 15, 2012
    Messages:
    3
    Likes Received:
    0
    hi
    i have a critical problem that i couldnt solve that for 1 week!
    i have 3 website with same codes and different skin, some page of one of these sites doesnt work correctly!
    in those pages i use this code :
    Server.MapPath("../Files/Article/") +...

    it should give me path of my site plus /Files/Article
    but abnormally it give me this address :
    D:\Plesk\fs

    it should give me this path : D:\Plesk\mysite.org\httpdocs\Files\Article
    !!!!
    and eventually it returns this error :

    Server Error in '/' Application.

    Could not find a part of the path 'D:\Plesk\fs\TempImage\C_000001.jpeg'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Plesk\fs\TempImage\C_000001.jpeg'.

    Source Error:


    Line 15: <asp:Label ID="lblPath" runat="server"></asp:Label>
    Line 16: </td>
    Line 17: <td><img border="0" src="<%=Session["imagePath"] %>/topBox-left_W.png" height="35"></td>
    Line 18: </tr>
    Line 19: </table>

    Source File: d:\plesk\mysite.org\httpdocs\website\viewArticle.aspx Line: 17
     
  2. PavelV

    PavelV Plesk for Windows Staff Member

    28
     
    Joined:
    Nov 15, 2010
    Messages:
    251
    Likes Received:
    15
    Could you please specify version of Plesk and version of your OS?
     
  3. PavelV

    PavelV Plesk for Windows Staff Member

    28
     
    Joined:
    Nov 15, 2010
    Messages:
    251
    Likes Received:
    15
    I suppose your site structure overlap with File Sharing service provided by Plesk.
    Go to Tools&Settings -> File Sharing Settings
    In "Web Folder root URL" parameter you will see your problem domain and virtual directory name, which is "files" by default.

    That's why you have "/files/..." converted to wrong file path.

    If you are not using File Sharing, you should either select another domain (maybe some technical domain), or specify any random virtual directory name, for example "files-that-should-be-never-accessed" or any random text.

    Unfortunately there is no easy way to disable this feature completely.
     
  4. samiakh

    samiakh New Pleskian

    10
     
    Joined:
    Oct 15, 2012
    Messages:
    3
    Likes Received:
    0
    my version is 11.0.9,no the issue was not about overlaping with file sharing service, i create a new subscription with new user,problem solved,
    i should mention that i created a new subscription before, with the same user (i delete user from mange in my computer and create subscription again) and problem had not been solved. i think when i delete subscription plesk doesnt delete it completely!
     
  5. PavelV

    PavelV Plesk for Windows Staff Member

    28
     
    Joined:
    Nov 15, 2010
    Messages:
    251
    Likes Received:
    15
    Filesharing enabled on one site only. Currently this is server-wide service, not subscription-wide. That's why:

    > i create a new subscription with new user, problem solved

    on this new subscription there is no filesharing service, and there is no overlap on new site.

    based on error message, I still think that you have filesharing service enabled on one of your sites and this site exactly will face such errors. Solution is to change virtual directory for Filesharing service from "files" to "share" or any other. I think your problem will be resolved for that site.
     
Loading...