Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 Access denied error with upload script
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  13:48:10  Show Profile
Here is the error message. Do you get anything from this?

Server Error in '/bio/enbiolog' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1002: ; expected


Edited by - Torborg on 16 August 2007 13:54:01
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 16 August 2007 :  13:59:04  Show Profile  Send ruirib a Yahoo! Message
Sorry, there was a ';' missing at the 2nd line:

Response.Write (FilePath + UploadedFileName);
Response.End;


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  14:01:24  Show Profile
I tried that too. But.. OK I'll try again :-)
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  14:03:38  Show Profile
Server Error in '/bio/enbiolog' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

Source Error:



Line 39: if (PhotoUpload.PostedFile.FileName != "")
Line 40: Response.Write (FilePath + UploadedFileName);
Line 41: Response.End;
Line 42: PhotoUpload.PostedFile.SaveAs(FilePath + UploadedFileName);
Line 43: {


Source File: f:\ekanal\www1\bio\enbiolog\testforum\pop_upload.aspx Line: 41





Edited by - Torborg on 16 August 2007 14:04:29
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  14:06:16  Show Profile
This error comes before I start to upload. It comes as the pop-up window opens
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 16 August 2007 :  14:08:41  Show Profile  Send ruirib a Yahoo! Message
Move both lines I suggested to before line 39;


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  14:14:12  Show Profile
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

Source Error:

Line 38: Int32 IntFileWidth = UploadedImage.Width;
Line 39: Response.Write (FilePath + UploadedFileName);
Line 40: Response.End;
Line 41: if (PhotoUpload.PostedFile.FileName != "")
Line 42: PhotoUpload.PostedFile.SaveAs(FilePath + UploadedFileName);


Source File: f:\ekanal\www1\bio\enbiolog\testforum\pop_upload.aspx Line: 40
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 16 August 2007 :  14:25:42  Show Profile  Visit HuwR's Homepage
Response.End;

should be

Response.End();
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  14:44:29  Show Profile
Yes! That was it.
And the message is:

F:\ekanal\www1\bio\enbiolog\\testforum\files\~images\16.08.2007 20:44:51_p1010051.jpg

But what do I do now?

Edited by - Torborg on 16 August 2007 14:59:07
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 16 August 2007 :  15:14:08  Show Profile
The problem must be the dobbel slash (?)
Can you spot where in the script that is?
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 16 August 2007 :  15:52:14  Show Profile  Send ruirib a Yahoo! Message
The problem is the ':'.

Change this line:
String UploadedFileName = MyDate.ToString("MMddyyyyhhmmss") + "_" + UploadedFile.Substring(ExtractPos,UploadedFile.Length - ExtractPos);

to

String UploadedFileName = MyDate.ToString("MMddyyyy_hh_mm_ss") + "_" + UploadedFile.Substring(ExtractPos,UploadedFile.Length - ExtractPos);


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 16 August 2007 :  16:14:38  Show Profile  Visit HuwR's Homepage
except use HH not hh otherwise there is a possibilty that you will get a duplicate name as hh uses 12 hr notation rather than 24hr
Go to Top of Page

Torborg
Junior Member

Norway
109 Posts

Posted - 17 August 2007 :  07:04:30  Show Profile
Thanks a lot both of you

I did as you said. Now i get a new error:


Server Error in '/bio/enbiolog' Application.
--------------------------------------------------------------------------------

Syntax error in INSERT INTO statement.
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.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.

Source Error:


Line 177: cmdImgIns = new OleDbCommand(strSQL, conImages);
Line 178: conImages.Open();
Line 179: cmdImgIns.ExecuteNonQuery();
Line 180: cmdImgIns.CommandText="SELECT @@IDENTITY As 'Identity';";
Line 181: OleDbDataReader reader = cmdImgIns.ExecuteReader();


Source File: f:\ekanal\www1\bio\enbiolog\testforum\pop_upload2.aspx Line: 179

Stack Trace:


[OleDbException (0x80040e14): Syntax error in INSERT INTO statement.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108
ASP.testforum_pop_upload2_aspx.SendToDB(String MemberID, String FilePath, String UploadedFileName, String UploadedDesc, Int32 IntFileSize, Int32 IntFileHeight, Int32 IntFileWidth, String FileType) in f:\ekanal\www1\bio\enbiolog\testforum\pop_upload2.aspx:179
ASP.testforum_pop_upload2_aspx.UploadBut_Click(Object sender, EventArgs args) in f:\ekanal\www1\bio\enbiolog\testforum\pop_upload2.aspx:45
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) +5102
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 17 August 2007 :  09:34:55  Show Profile  Send ruirib a Yahoo! Message
At line 178, add this:

Response.Write (strSQL);
Response.End();

Post the results.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07