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
nj********@hotmail.com http://www.nathansokalski.com/
"Reddy" <Re***@discussions.microsoft.com> wrote in message
news:1E**********************************@microsof t.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.SaveA s(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
nj********@hotmail.com
http://www.nathansokalski.com/
"Reddy" <Re***@discussions.microsoft.com> wrote in message
news:5C**********************************@microsof t.com... > System.Web.UI.HtmlControls.HtmlInputFile.SaveAs(Fi leName) 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