简体   繁体   中英

The given path's format is not supported.

In my localhost it works correctly when I publish it and up to sever this error happens

path = string.Format(@"{0}{1}\{2}", Server.MapPath("~"), @"Files\Images", ShortImage.FileName.ToString());
            ShortImage.InputStream.ResizeImage(150, 150, path, Utilty.ImageComperssion.Normal);

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.NotSupportedException: The given path's format is not supported.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

This might be a long shot but if your path somewhere where your website cannot access? Granted, you as a windows user may be able to access the "E" drive, but, assuming you are running this from a published site that is not located on E drive or maybe limited to maybe just it's directory, there may be an access issue. Best way to test it is to put the path to something inside the project folder and see what happens.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM