|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
..HtmlControls.HtmlInputFile.Saveas(filename) not overwritingSystem.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not overwriting
the file. It used to work fine on IIS5.1 Recently we migrated to IIS6.0. Since then it's not working. If it's new file it works fine. For the same file getting the error "Access to the path "" denied. I gave fullcontorl to ASPNET user on the folder. Please help me. Thanks reddy When using the HtmlInputFile control, you must use
Web.UI.HtmlControls.HtmlInputFile.PostedFile.SaveAs(FileName) to save it, the SaveAs method is NOT a method of the HtmlInputFile class. I have not seen all of your code, but see if it works when you make this change. Good Luck! Show quoteHide quote "Reddy" <Re***@discussions.microsoft.com> wrote in message news:5C2D9E94-2F28-46FA-9949-0DC02F6318C7@microsoft.com... > System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not > overwriting > the file. It used to work fine on IIS5.1 Recently we migrated to IIS6.0. > Since then it's not working. If it's new file it works fine. > For the same file getting the error > "Access to the path "" denied. > I gave fullcontorl to ASPNET user on the folder. > > Please help me. > Thanks > reddy Yes, I am using that only. But not working. As i said. It works for file
first time. If you try to load same file it give access denied error, which supposed to overwrite the old file. Thanks Show quoteHide quote "Nathan Sokalski" wrote: > When using the HtmlInputFile control, you must use > Web.UI.HtmlControls.HtmlInputFile.PostedFile.SaveAs(FileName) to save it, > the SaveAs method is NOT a method of the HtmlInputFile class. I have not > seen all of your code, but see if it works when you make this change. Good > Luck! > -- > Nathan Sokalski > njsokal***@hotmail.com > http://www.nathansokalski.com/ > > "Reddy" <Re***@discussions.microsoft.com> wrote in message > news:5C2D9E94-2F28-46FA-9949-0DC02F6318C7@microsoft.com... > > System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not > > overwriting > > the file. It used to work fine on IIS5.1 Recently we migrated to IIS6.0. > > Since then it's not working. If it's new file it works fine. > > For the same file getting the error > > "Access to the path "" denied. > > I gave fullcontorl to ASPNET user on the folder. > > > > Please help me. > > Thanks > > reddy > > > I am not sure if this is the problem, but try checking the ReadOnly property
of the file after you write it the first time. I am not sure what SaveAs sets the properties to when it saves it. Even though it is not what you are looking for, a one-line if statement testing for and deleting the file before the SaveAs wouldn't be hard, such as in the following: If IO.File.Exists(Server.MapPath("myfile.txt")) Then IO.File.Delete(Server.MapPath("myfile.txt")) It's only one line, and the code is very simple, so if my ReadOnly property idea isn't the problem, I would just use that rather than frustrate yourself trying to figure it out. You can always work on it in your free time (and maybe if you're lucky some will respond in the future with a solution, sometimes it takes a while to get responses that actually fix the problem). Good Luck! Show quoteHide quote "Reddy" <Re***@discussions.microsoft.com> wrote in message news:1EAAF9EC-2233-4A71-8531-A3856B8FCE88@microsoft.com... > Yes, I am using that only. But not working. As i said. It works for file > first time. If you try to load same file it give access denied error, > which > supposed to overwrite the old file. > > Thanks > > "Nathan Sokalski" wrote: > >> When using the HtmlInputFile control, you must use >> Web.UI.HtmlControls.HtmlInputFile.PostedFile.SaveAs(FileName) to save it, >> the SaveAs method is NOT a method of the HtmlInputFile class. I have not >> seen all of your code, but see if it works when you make this change. >> Good >> Luck! >> -- >> Nathan Sokalski >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> >> "Reddy" <Re***@discussions.microsoft.com> wrote in message >> news:5C2D9E94-2F28-46FA-9949-0DC02F6318C7@microsoft.com... >> > System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not >> > overwriting >> > the file. It used to work fine on IIS5.1 Recently we migrated to >> > IIS6.0. >> > Since then it's not working. If it's new file it works fine. >> > For the same file getting the error >> > "Access to the path "" denied. >> > I gave fullcontorl to ASPNET user on the folder. >> > >> > Please help me. >> > Thanks >> > reddy >> >> >> ReadOnly Property is not problem. So i am following the other idea. I too
hope somebody will give the anwer. Thanks reddy Show quoteHide quote "Nathan Sokalski" wrote: > I am not sure if this is the problem, but try checking the ReadOnly property > of the file after you write it the first time. I am not sure what SaveAs > sets the properties to when it saves it. Even though it is not what you are > looking for, a one-line if statement testing for and deleting the file > before the SaveAs wouldn't be hard, such as in the following: > > If IO.File.Exists(Server.MapPath("myfile.txt")) Then > IO.File.Delete(Server.MapPath("myfile.txt")) > > It's only one line, and the code is very simple, so if my ReadOnly property > idea isn't the problem, I would just use that rather than frustrate yourself > trying to figure it out. You can always work on it in your free time (and > maybe if you're lucky some will respond in the future with a solution, > sometimes it takes a while to get responses that actually fix the problem). > Good Luck! > -- > Nathan Sokalski > njsokal***@hotmail.com > http://www.nathansokalski.com/ > > "Reddy" <Re***@discussions.microsoft.com> wrote in message > news:1EAAF9EC-2233-4A71-8531-A3856B8FCE88@microsoft.com... > > Yes, I am using that only. But not working. As i said. It works for file > > first time. If you try to load same file it give access denied error, > > which > > supposed to overwrite the old file. > > > > Thanks > > > > "Nathan Sokalski" wrote: > > > >> When using the HtmlInputFile control, you must use > >> Web.UI.HtmlControls.HtmlInputFile.PostedFile.SaveAs(FileName) to save it, > >> the SaveAs method is NOT a method of the HtmlInputFile class. I have not > >> seen all of your code, but see if it works when you make this change. > >> Good > >> Luck! > >> -- > >> Nathan Sokalski > >> njsokal***@hotmail.com > >> http://www.nathansokalski.com/ > >> > >> "Reddy" <Re***@discussions.microsoft.com> wrote in message > >> news:5C2D9E94-2F28-46FA-9949-0DC02F6318C7@microsoft.com... > >> > System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not > >> > overwriting > >> > the file. It used to work fine on IIS5.1 Recently we migrated to > >> > IIS6.0. > >> > Since then it's not working. If it's new file it works fine. > >> > For the same file getting the error > >> > "Access to the path "" denied. > >> > I gave fullcontorl to ASPNET user on the folder. > >> > > >> > Please help me. > >> > Thanks > >> > reddy > >> > >> > >> > > > Thw worst part is still i am getting same error on deltete statement.
Thanks Prahlad Show quoteHide quote "Reddy" wrote: > ReadOnly Property is not problem. So i am following the other idea. I too > hope somebody will give the anwer. > Thanks > reddy > > "Nathan Sokalski" wrote: > > > I am not sure if this is the problem, but try checking the ReadOnly property > > of the file after you write it the first time. I am not sure what SaveAs > > sets the properties to when it saves it. Even though it is not what you are > > looking for, a one-line if statement testing for and deleting the file > > before the SaveAs wouldn't be hard, such as in the following: > > > > If IO.File.Exists(Server.MapPath("myfile.txt")) Then > > IO.File.Delete(Server.MapPath("myfile.txt")) > > > > It's only one line, and the code is very simple, so if my ReadOnly property > > idea isn't the problem, I would just use that rather than frustrate yourself > > trying to figure it out. You can always work on it in your free time (and > > maybe if you're lucky some will respond in the future with a solution, > > sometimes it takes a while to get responses that actually fix the problem). > > Good Luck! > > -- > > Nathan Sokalski > > njsokal***@hotmail.com > > http://www.nathansokalski.com/ > > > > "Reddy" <Re***@discussions.microsoft.com> wrote in message > > news:1EAAF9EC-2233-4A71-8531-A3856B8FCE88@microsoft.com... > > > Yes, I am using that only. But not working. As i said. It works for file > > > first time. If you try to load same file it give access denied error, > > > which > > > supposed to overwrite the old file. > > > > > > Thanks > > > > > > "Nathan Sokalski" wrote: > > > > > >> When using the HtmlInputFile control, you must use > > >> Web.UI.HtmlControls.HtmlInputFile.PostedFile.SaveAs(FileName) to save it, > > >> the SaveAs method is NOT a method of the HtmlInputFile class. I have not > > >> seen all of your code, but see if it works when you make this change. > > >> Good > > >> Luck! > > >> -- > > >> Nathan Sokalski > > >> njsokal***@hotmail.com > > >> http://www.nathansokalski.com/ > > >> > > >> "Reddy" <Re***@discussions.microsoft.com> wrote in message > > >> news:5C2D9E94-2F28-46FA-9949-0DC02F6318C7@microsoft.com... > > >> > System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(FileName) is not > > >> > overwriting > > >> > the file. It used to work fine on IIS5.1 Recently we migrated to > > >> > IIS6.0. > > >> > Since then it's not working. If it's new file it works fine. > > >> > For the same file getting the error > > >> > "Access to the path "" denied. > > >> > I gave fullcontorl to ASPNET user on the folder. > > >> > > > >> > Please help me. > > >> > Thanks > > >> > reddy > > >> > > >> > > >> > > > > > >
Other interesting topics
Loading UserControl using New Contructor
vs2005 debugging on ws2k3 server Storing an array to a Session Virtual Directory How do I run a server side method from javascript?! Path conversion Stop the refresh in WebPages when i Press Back Button on the Menu there is an Issue self-signed certificate for Windows XP MessageBox |
|||||||||||||||||||||||