writing xml on folder existing on server

Posted by Shoyebaziz123 under ASP.NET on 7/5/2010 | Views : 1476 | Status : [Member] | Replies : 3
Hi All,
i have create an application for generating xml file ... it is running on local machine correcctly , while running on web some error are generated

using this line of code i have make the instance of xml file

str = Server.MapPath("./XMLFile/SampleITR1_2010-11.xml")
mXmlDataSet.ReadXml(str)
now here is my remaining coding

.
.
.

lastly

strMessage = Server.MapPath("./XMLFile/")
intRandomNumber = RandomGenerator.Next(1, 100)
mXmlDataSet.WriteXml(strMessage & mPersonDetails.Tables("PerDetails").Rows(0).Item("AssessYear").ToString & "-ITR1-" & str & "-" & intRandomNumber & ".Xml")

but it shows the error of


"Access to the path 'C:\whb\Sites\20614\Web\XMLFile\2010-11-ITR1-XXXXX0000X-48.Xml' is denied. "


what is going wrng or what is the solution for this....

Thanks




Responses

Posted by: Raja on: 7/5/2010 [Member] Starter

Up
0
Down
Its frequently asked question while writing file on the server. Go to the folder on the server and right click. Go to Security tab and ensure that the ASP.NET/user* or your virtual directory user (in case of server), or ASP.NET user has permission of read/write/modify the files.

This error is related with the security setting of the folder in which you want to write xml, just give proper permission and you should be able to resolve this problem.

Thank you.

Regards,
Raja, USA

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shoyebaziz123 on: 7/5/2010 [Member] Starter

Up
0
Down
Thanks for Your reply,
But when i am right clicking on my folder it shows only General Tab and there is two button O and Cacel only.


Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 7/5/2010 [Member] Starter

Up
0
Down
That means you do not have necessary priveledge to modify the permission of that folder. Ask for Administrtor previledge to your server and you should be able to do that.

Thank you.

Regards,
Raja, USA

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response