salve boys
ho fatto il classico form di upload che in locale funziona benissimo!
ho fatto così :
int dimensione = inputFile.PostedFile.ContentLength;
string inputFilePath = inputFile.PostedFile.FileName;
string inputFileName = System.IO.Path.GetFileName(inputFilePath);
inputFile.PostedFile.SaveAs("upload\\" + inputFileName);
vado a salvare i miei file in una cartella "upload"!ma quando faccio l'upload mi da il seguente errore :
The SaveAs method is configured to require a rooted path, and the path 'upload\\banner.gif' is not rooted.
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.Web.HttpException: The SaveAs method is configured to require a rooted path, and the path 'upload\\banner.gif' is not rooted.
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.
Stack Trace:
[HttpException (0x80004005): The SaveAs method is configured to require a rooted path, and the path 'sarafitness.it\public\bannerwebsorpasso.gif' is not rooted.]
System.Web.HttpPostedFile.SaveAs(String filename) +3322707
upload.BtnUp_Click(Object s, EventArgs e) +111
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
ho trovato dei post a riguardo ma nessuno è chiaro nella soluzione!potete consigliarmi?
grazie