I'm facing problem when I'm trying to upload large file i.e. more than 4 mb it is throwing me an error.
unterminated string or constant.
AttPages/frmAttch.aspx?hsTable=hsAttach'
I have included following line of code in my web.config file
<httpRuntime executionTimeout="3600" maxRequestLength="65536"/>
but of no use in my case.
when i'm using attachment webservice which is installed on server(windows server 2003), than I'm able to upload more even more than 60mb.
but when i'm using webservice which is installed on my local m/c (windows vista), than not able to upload more than 4mb.
In both cases website and its config file is same only service installation place is diffrent but web service is same.
Is there any machine related config is required which is already there on server and i dont have it on my local machin.
or kind of restrictions.
can any one suggest me what could be the problem.
Below is the code snippets of web service.
public String AttachFile(string strFolderPath, string strFile, byte[] fileBuffer)
{
FileStream _FileStream = null;
DirectoryInfo _Folder = new DirectoryInfo(strFolderPath);
if (!_Folder.Exists)//Checks if the folder exists in the given path else creates it.
{
_Folder.Create();
_Folder.SetAccessControl(new System.Security.AccessControl.DirectorySecurity(strFolderPath, System.Security.AccessControl.AccessControlSections.Owner));
}
try
{
_FileStream = new FileStream(strFolderPath + "\\" + strFile, FileMode.Create);
_FileStream.Write(fileBuffer, 0, fileBuffer.Length);
_FileStream.Close();
return "True";
}
catch (Exception Ex)
{
return Ex.Message;
}
}
with following webconfig file.
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings />
<connectionStrings />
<system.web>
<authentication mode="Windows" />
<identity impersonate="true" userName="astral\EERADMIN" password="pass@123" />
<customErrors mode="Off" />
<sessionState timeout="1440" />
<httpRuntime maxRequestLength="102400" executionTimeout="240" />
<compilation debug="true" defaultLanguage="c#" />
<roleManager enabled="true" />
</system.web>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" />
</authentication>
</security>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>