|
I am using the FileUpload control to upload files from client's local HDD to the server
But the code always searches for the file path on the server side
e.g.
If the user tried to upload a file C:\1.txt from his machine, He gets an exception "Could not find file C:\1.txt"
But if there is a file with the same path on the server it works and upload the server file instead
How can work around that
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Mohammed Gouda wrote: But the code always searches for the file path on the server side
Your code is broken. Post the code which you are using for upload.
|
|
|
|
|
Hey, Navaneeth,
Wishing You and Your Family A Very Happy and Prosperous New Year !!!
cheers,
Abhijit
|
|
|
|
|
Thanks and wishing you too. 4 hours to go!
|
|
|
|
|
N a v a n e e t h wrote: Thanks Smile and wishing you too.
Thanks Man !!!
N a v a n e e t h wrote: 4 hours to go!
Ya!!! But Still Hanging in Office
Hope tonight have a party !!!
Enjoy !!!
cheers,
Abhijit
|
|
|
|
|
What is the .NET Framework version ?
|
|
|
|
|
What is the .NET framework version ?
Marcello Turnbull
|
|
|
|
|
Thanks to all participants
I solved it
I had a server side method as follows
AddAttachment(string filePath)
{
FileStream fs = new FileStream(filePath, FileMode.Open);
}
To solve the problem, I changed the method to
AddAttachment(byte [] fileContents)
{
}
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Hi i am Datta,
i have aspx containg Window User control .
This Window user control have a textbox and setter property to set text of textbox.
i embedded this User Control inside aspx and want to communicate aspx textbox with that textbox of user control via Javascript.
but i am failed to set value of textbox of User control.
I am Using .NET 2.0 VS 2005 and C# lang.
If any body knows solution
thanks in advance..
DaTtA
|
|
|
|
|
Please ignore
Cheers!!
Brij
|
|
|
|
|
Hi all,
I need to auto send email when some posted a new ticket/event in my project.Please help me to achieve.
Thanks a lot.
|
|
|
|
|
kavitha_blueindia wrote: I need to auto send email when some posted a new ticket/event in my project.
If you need to send it on a event then just write code for send mail on that event. or you want something else .
cheers,
Abhijit
|
|
|
|
|
You can use the method below.
C#
public void SendMail(string smtpAddress, string from,string to, string cc, string bcc, string body, string subject, bool isHtml,string attachmentFileNames)
{
SmtpClient insSmtpClient = new SmtpClient(smtpAddress);
MailMessage insMailMessage = new MailMessage();
insMailMessage.From = new MailAddress(from);
foreach (string strBcc in bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.Bcc.Add(strBcc);
}
foreach (string strTo in to.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.To.Add(strTo);
}
foreach (string strCc in cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.CC.Add(strCc);
}
insMailMessage.Body = body;
insMailMessage.Subject = subject;
insMailMessage.IsBodyHtml = isHtml;
foreach (string strAtt in attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.Attachments.Add(new Attachment(strAtt));
}
insSmtpClient.Send(insMailMessage);
}
Kopyala
--------------------------------------------------------------------------------
VB.Net
Public Sub SendMail(ByVal smtpAddress As String, ByVal from As String, ByVal [to] As String, ByVal cc As String, ByVal bcc As String, ByVal body As String, _
ByVal subject As String, ByVal isHtml As Boolean, ByVal attachmentFileNames As String)
Dim insSmtpClient As New SmtpClient(smtpAddress)
Dim insMailMessage As New MailMessage()
insMailMessage.From = New MailAddress(from)
For Each strBcc As String In bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.Bcc.Add(strBcc)
Next
For Each strTo As String In [to].Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.[To].Add(strTo)
Next
For Each strCc As String In cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.CC.Add(strCc)
Next
insMailMessage.Body = body
insMailMessage.Subject = subject
insMailMessage.IsBodyHtml = isHtml
For Each strAtt As String In attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.Attachments.Add(New Attachment(strAtt))
Next
insSmtpClient.Send(insMailMessage)
End Sub
|
|
|
|
|
This is not the requirement. Main requirements is to send mail automatically with in a event.
cheers,
Abhijit
|
|
|
|
|
Actually, it is relevant, why wouldn't you just place that method call inside of the event being triggered?
|
|
|
|
|
I wrote an article on how to use google, I used sending emails as my example because
1 - it's SO easy to do
2 - there's SO much info on google about it and
3 - there's still SO many people too stupid to work it out.
It's on this site, you should read it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
I am creating Admin page for my project(ASP.Net 3.5 with MS Access).I got Access provider for Membership and Roles.
Membership is working well but for Roles it returns error message when run ASP.Net Website administration Tool and clicking the link "Use the security Setup Wizard to configure security step by step."
Error:
An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem: Object reference not set to an instance of an object. at System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) at System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.ListControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at ASP.security_wizard_wizardpermission_ascx.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
can anyone guide how to solve this error?
modified on Thursday, January 1, 2009 11:39 PM
|
|
|
|
|
my application working fine in local and some other computers
but in few computers it on same lan it is giving error
unhandled expception occur for error place custom errors in web.config and set its mode to off
can anyone guide how to solve this error?
umerumerumer
|
|
|
|
|
mr_muskurahat wrote: unhandled expception occur for error place custom errors in web.config and set its mode to off
This is very common error in web application. Did you searched google for that ?
cheers,
Abhijit
|
|
|
|
|
For getting the details of the error,set custom errors in web.config and set its mode to off.Then you'll get the details
Cheers!!
Brij
|
|
|
|
|
ok thanks lets see...
umerumerumer
|
|
|
|
|
Do let me know the problem
Cheers!!
Brij
|
|
|
|
|
Hi frnds...
I create a one website on asp.net, but i don't know how to put website on server. plz help me & give full introduction about that. like web.config seting or other..
And also give the name they can provide free hosting on server.
Thankx.
|
|
|
|
|
Where do you want to host ? is it on local server or any hosting sites ?
cheers,
Abhijit
|
|
|
|
|
Bony_patel wrote: but i don't know how to put website on server. plz help me & give full introduction about that
Bony_patel wrote: And also give the name they can provide free hosting on server.
You have to ask your ISP to know why google is not working for you.
|
|
|
|