Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Error when uploading a file View modes: 
User avatar
Member
Member
quickpaw2000-hotmail - 6/16/2010 6:28:50 AM
   
Error when uploading a file
Hi all,

I seem to be having a issue when trying to upload a file into Kentico. I get this error after I hit upload, and then press Save:

Insert new file failed: [GeneralConnection.RunQuery]: Query 'CMS.File.insert' not found.

This is also from a fresh install of Kentico 5.5 with the latest hotfix, 5.5.3817.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 6/16/2010 7:46:01 AM
   
RE:Error when uploading a file
Hello,

It seems, you are missing the query "insert" for the mentioned document type. Could you please try to create it manually in CMSSiteManager->Development->Document Types->CMS.File->Queries? Please create a new entry with the name "insert" and past the following text:


INSERT INTO CONTENT_File ([FileName], [FileDescription], [FileAttachment] ) VALUES ( @FileName, @FileDescription, @FileAttachment); SELECT SCOPE_IDENTITY() AS [FileID]


Please tick the options "Requires transaction" and "Query text".

Best regards,
Boris Pocatko

User avatar
Member
Member
quickpaw2000-hotmail - 6/18/2010 7:10:18 AM
   
RE:Error when uploading a file
I managed to get around the problem by just completely reinstalling a fresh copy of Kentico 5.5 and applying the latest hotfix.

However, I have a new problem. As of now, if I try to create a new Folder, or anything except a Page (Menu Item), I get this error:

Server Error in '/' Application.
A potentially dangerous Request.Form value was detected from the client (formElem_form_BlogDescription="asd<br />").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. To allow pages to override application request validation settings, set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0". Example: <httpRuntime requestValidationMode="2.0" />. After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (formElem_form_BlogDescription="asd<br />").

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:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (formElem_form_BlogDescription="asd<br />").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +11309476
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +82
System.Web.HttpRequest.get_Form() +186
CMS.GlobalHelper.RequestHelper.IsCallback() +86
CMS.CMSOutputFilter.OutputFilterModule.app_AuthenticateRequest(Object sender, EventArgs e) +21
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266

Any ideas? I need to get this resolved as fast as possible.

User avatar
Member
Member
quickpaw2000-hotmail - 6/18/2010 7:12:16 AM
   
RE:Error when uploading a file
Just to clarify, the above error was from creating a Blog entry. This is what I get when I try to add a new Folder:

Server Error in '/' Application.
A potentially dangerous Request.Form value was detected from the client (ucNewProduct_htmlSKUDescription="<br />").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. To allow pages to override application request validation settings, set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0". Example: <httpRuntime requestValidationMode="2.0" />. After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ucNewProduct_htmlSKUDescription="<br />").

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:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ucNewProduct_htmlSKUDescription="<br />").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +11309476
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +82
System.Web.HttpRequest.get_Form() +186
CMS.GlobalHelper.RequestHelper.IsCallback() +86
CMS.CMSOutputFilter.OutputFilterModule.app_AuthenticateRequest(Object sender, EventArgs e) +21
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/21/2010 7:04:03 AM
   
RE:Error when uploading a file
Hi,

Which version of .Net framework and Kentico CMS are you using? Have you tried the suggestion in the error message - changing the requestValidationMode property?

Please see also: http://www.aspcode.net/A-potentially-dangerous-RequestForm-value-was-detected-from-the-client.aspx

Which fields are enabled for the blog posts documents on the live site?

Best regards,
Juraj Ondrus


User avatar
Member
Member
quickpaw2000-hotmail - 6/24/2010 7:03:42 AM
   
RE:Error when uploading a file
My shared hosting (Softsys) is using .NET 4. I finally got this to work by making a addition to this line in the web.config:

<httpRuntime requestValidationMode="2.0" maxRequestLength="2097151" waitChangeNotification="1" maxWaitChangeNotification="3600" />

All instances of that error seem to be gone now. Thanks again for the link! I don't think I would of figured it out. I'm still learning .NET.