Hello i am working on a customer file uploader. This is pre-sale, so i dont want it part of a kit. Basically a custom contact form with ability for client to upload a pdf or word doc. I borrowed some code from cforrester, but cannot get it to work.
The form has a file browse button and a submit button:
<body>
<form name="form1" method="post" action="upload_logo.aspx?cid=0&pid=82&lip= 000.000.187.37" id="form1" enctype="multipart/form-data">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTYzNDA0Mjg1D2QWAgIDDxYCHgdlbmN0eXBlBRNtdWx 0aXBhcnQvZm9ybS1kYXRhZGTl6YqW40Hxqtnpf8q0qjkAjbLda w==" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLEsfvwBwKx6NOBD0FALG6b8YUhxUMegqbMqR4a27MF" />
<strong> <br />
Upload RFQ or Program</strong><br />
</strong>
<br />
Click Browse to select your RFQ file; then click Upload File to upload the file
to our server.<br />
<br />
<input type="file" name="fu" id="fu" /><br />
<br />
<input type="submit" name="uxUpload" value="Upload File" id="uxUpload" /
It fails on upload with the following error from aspdotnetstorefront:
[ViewStateException: Invalid viewstate.
Client IP: 000.000.15.233
Port: 64074
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
ViewState: /wEPDwUJNTYzNDA0Mjg1D2QWAgIDDxYCHgdlbmN0eXBlBRNtdWx 0aXBhcnQvZm9ybS1kYXRhZGTl6YqW40Hxqtnpf8q0qjkAjbLda w==
Referer: http://www.mydomain.com/upload_logo....=174.36.187.37
Path: /upload_logo.aspx]
[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
System.Web.UI.ViewStateException.ThrowError(Except ion inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
System.Web.UI.ViewStateException.ThrowMacValidatio nError(Exception inner, String persistedState) +14
System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +237
System.Web.UI.ObjectStateFormatter.System.Web.UI.I StateFormatter.Deserialize(String serializedState) +4
System.Web.UI.Util.DeserializeWithAssert(IStateFor matter formatter, String serializedState) +37
System.Web.UI.HiddenFieldPageStatePersister.Load() +207
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +105
System.Web.UI.Page.LoadAllState() +43
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
System.Web.UI.Page.ProcessRequest() +80
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.upload_logo_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +75
I dont know what the CID, PID, and LIP do? Any suggestions greatly appreciated.
Press