473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Dec 22 '05 #1
5 1828
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

Dec 23 '05 #2
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


Dec 23 '05 #3
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


Dec 23 '05 #4
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
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


Dec 27 '05 #5
Thw worst part is still i am getting same error on deltete statement.
Thanks
Prahlad

"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
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
>
>
>


Dec 28 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: UJ | last post by:
How can I add a browse button to my asp.net page? What I need is a button they can press that will then let them select the file to upload to the server. And if anybody has any good code on how...
2
by: Lars Netzel | last post by:
I want to overwrite an excel file I have opened but I do not want to get the question "Do you want to overwrite" .. .I just want to it overwrite silent.. How do i do this? wbk =...
2
by: mark13.pl | last post by:
Hi, In word macro such thing worked perfectly: With ActiveDocument .SaveEncoding = msoEncodingUTF8 .SaveAs FileName:="c:\test.doc", FileFormat:=wdFormatUnicodeText End With When I tried to...
1
by: billforde | last post by:
How do I find out what filename the user entered after they are prompted by a call to document.execCommand("SaveAs")?
1
by: wasishincar | last post by:
Hi all, I wrote a small app, which could read text file and fill the data from text file to a newly created excel file. It works fine on my computer, but did not succeed on someone's. I caught...
1
by: daokfella | last post by:
I have a web usercontrol on which is a Webcontrols.FileUpload control. I expose the PostedFile property as a readonly property of the usercontrol. That way, a page has access to it. However,...
1
by: flickimp | last post by:
Hi I have an excel file with 20 sheets. Now then... I am only interested in one Sheet (2 pages) and I want to save that to a particular folder. Also, the sheet is dependent on Cell D7...
3
by: GS | last post by:
I ma in the process of automating/expediting some download from a secure website, when Currently I would click on the control webbrowser to view and then on the popup choose save, then change the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.