Home All Groups Group Topic Archive Search About

..HtmlControls.HtmlInputFile.Saveas(filename) not overwriting

Author
22 Dec 2005 5:57 PM
Reddy
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

Author
23 Dec 2005 4:52 AM
Nathan Sokalski
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/

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
Are all your drivers up to date? click for free checkup

Author
23 Dec 2005 2:30 PM
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
>
>
>
Author
23 Dec 2005 10:21 PM
Nathan Sokalski
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/

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
>>
>>
>>
Author
27 Dec 2005 8:39 PM
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
> >>
> >>
> >>
>
>
>
Author
28 Dec 2005 7:58 PM
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
> > >>
> > >>
> > >>
> >
> >
> >

Bookmark and Share