|
Sir, Thank you for reply..
There is permission for folder and path is also exist.
|
|
|
|
|
Okay, so assuming they exist (and the file also exists), what is the actual error you are receiving?
|
|
|
|
|
Sir, This is the error i'm getting..
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 42:
Line 43: Public Sub CheckWH()
Line 44: Dim fullSizeImg As System.Drawing.Image = System.Drawing.Image.FromFile(str)
Line 45:
Line 46:
Source File: D:\Hosting\5201676\html\Gallery.aspx.vb Line: 44
i think it is giving error for FromFile(str). Whether FromFile() is used only to get path from localhost ?
Plse reply..
|
|
|
|
|
I have a app that when ran locally will upload my file to the database but if I try remotely it can't find the file. I am using the fileupload control and streaming it to the database. Is there a permission setting I am missing? This is called from the button_click of a submit button
byte[] ReadFile(string sPath)
{
byte[] data = null;
FileInfo fInfo = new FileInfo(sPath);----THIS IS WHERE IT CANT FIND sPath
long numBytes = fInfo.Length;
FileStream fStream = new FileStream(sPath, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fStream);
data = br.ReadBytes((int)numBytes);
return data;
}
|
|
|
|
|
Check the value in the sPath if it actually exists on the server.
If sPath is the path that FileUpload control has provided, it will obviously not work. Since it is the path of the file on the client computer and this code runs on server.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Correct its the path of the client computer. So how do I fix it?
|
|
|
|
|
Well my solution was I created a folder for the upload control to upload to then my sp would go grab the file for the folder on the server and insert into the table. This worked.
|
|
|
|
|
Hi all,
I am using HTML image for calendar control in my application.As per the requirement i have to disable the calender control.In IE it is working fine but in Mozilla FireFox is not working.
Ex:-In code behind i disabled the control to avoid to open calender like the following.
ImgInceptionDate.Disabled = true;--->This line is working in IE
The same is not working in firefox-->Here i can able to open calender.
Can any one help on this???
thanks in advance,
Eswar.
|
|
|
|
|
I need some help regarding chat application..
I want the flow chart for work flow to build a chat program in asp.net.
plz help. I need to know how to implement the chatting like yahoo chat..
|
|
|
|
|
vinci007 wrote: I want the flow chart for work flow to build a chat program in asp.net.
plz help. I need to know how to implement the chatting like yahoo chat..
What kind of work flow you are looking for ?
Here is few sample :
ASP.NET Ajax Chat Application[^]
and
Simple Chat Application in ASP.NET[^]
Hope this will help you go ahead.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I think this has been asked here for at least 10 times... Did you search before asking ?
|
|
|
|
|
Abhishek Sur wrote: I think this has been asked here for at least 10K times... Did you search before asking ?
FTFY
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
|
I have Created a pdf file by using pdfSharp and save in a location.but when i want to open that pdf file on the link button click event down load dialogue box is appear and when i clicked the open button.Adobe Reader throws the Strange Error message.the Error Message is
Adobe Reader couldn't open "invoice__2009[1].pdf because it is either not supported file type or because the file has been damaged(for example it was sent as an email attachment and wasn't correctly decoded)
(my filename is only invoice__2009 but [1] is extra comming in the message)
can you help me for this matter?
My code sample is
string inv = Session["invN0"].ToString();
Response.Clear();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + inv);
Response.TransmitFile(Server.MapPath(("~/") + "Shopping/pdfInvoice/" + inv));
Response.End();
Thank You
Pawan
|
|
|
|
|
Check the response. I think you are ending the response before writing the output.
Also use Response.BinaryWrite to write binary data in response.
|
|
|
|
|
I also tried that but the result is same.
This code works when I used it on same Block where i generate the pdf.But when i pass the Pdf file name in session and used it in the Button click event this error throws.
|
|
|
|
|
hii
i want that at a time only one item can be selected in a text box.for this i have written following code at selected index changed event but its not working f9.plz tell me where m i wrong...
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
for (int i=0; i < CheckBoxList1.Items.Count-1; i++)
{
if (CheckBoxList1.Items[i].Selected == true)
{
for (int j = i + 1; j <= CheckBoxList1.Items.Count - 1; j++)
{
CheckBoxList1.Items[j].Selected = false;
}
}
else
{
CheckBoxList1.Items[i].Selected = false;
}
}
}
|
|
|
|
|
If you want only one item to be selected, use radio buttons. Not check box.
Best wishes,
Navaneeth
|
|
|
|
|
if i want to do it using checkbox what shud i do.can i do this without using script.
|
|
|
|
|
Just put one Javascript which might uncheck all other checkboxes whenever one checkbox is checked.
var thiselement = null;
var elem = document.getElementsByName('groupname');
for(var i=0; i<=elem.length; i++){
if(!elem[i].id.equals('checkboxclientid')
elem[i].checked = false;
else
thiselement = elem[i];
}
thiselement.checked = true;
Just pass appropriate groupname and checkboxclientid and you are done.
Cheers.
|
|
|
|
|
mylogics wrote: .can i do this without using script.
FYI : Abhishek, I guess he is not looking for Script.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Yes.... But How can he do this without script.. .There is no way.. If he dont want to use script.. only way out is to move to Radiobutton...
|
|
|
|
|
If you want to select only one item at a time then please use radio button
Thanks
|
|
|
|
|
hi,
Is there any artical or any code is there to make good forum for post and reply
thanks.
|
|
|
|
|