I have uploaded my project on the server(Bigrock). but when i try to upload documents it gives me an error A generic error occurred in GDI.
It is working fine on my localhost.
protected void attach_Click(object sender, EventArgs e)
{
List<HttpPostedFile> files = new List<HttpPostedFile>();
for (int i = 0; i < Request.Files.Count; i++)
{
files.Add(Request.Files[i]);
}
lstview.DataSource = (from f in files select new { Text = f.FileName }).ToList();
lstview.DataBind();
Session["Files"] = files;
}
<asp:FileUpload ID="uploadresume" multiple="true" Class="multi" runat="server" />
<asp:Button ID="attach" runat="server" Text="Attached" OnClick="attach_Click" CssClass="btn-yellow" style="margin-left:30px;" />
<asp:Button ID="upload" runat="server" Text="upload" OnClick="upload_Click" CssClass="btn-blue" />
<script language="javascript" type="text/javascript">
function AddMoreImages() {
if (!document.getElementById && !document.createElement)
return false;
var fileUploadarea = document.getElementById("fileUploadarea");
if (!fileUploadarea)
return false;
var newLine = document.createElement("br");
fileUploadarea.appendChild(newLine);
var newFile = document.createElement("input");
newFile.type = "file";
newFile.setAttribute("class", "fileUpload");
if (!AddMoreImages.lastAssignedId)
AddMoreImages.lastAssignedId = 100;
newFile.setAttribute("id", "FileUpload" + AddMoreImages.lastAssignedId);
newFile.setAttribute("name", "FileUpload" + AddMoreImages.lastAssignedId);
var div = document.createElement("div");
div.appendChild(newFile);
div.setAttribute("id", "div" + AddMoreImages.lastAssignedId);
fileUploadarea.appendChild(div);
AddMoreImages.lastAssignedId++;
}
</script>
<script type="text/javascript">
function callme() {
document.getElementById('<%=uploadresume.ClientID%>').value = document.getElementById('<%=uploadresume.ClientID %>').value;
}
</script>