I would like users to be able to create a sitemap.xml file on the fly and store it in the root. I don't really want to give write permissions on the root folder.
Thanks. I was referring to a google sitemap.xml file that is generated based on URLs that are generated from a SQL Server database. I have a stored proc that basically returns records containing
I ended up rendering the file on the fly using FileStreamResult. Sitemap.xml or sitemap.xml.gz can always be found even though it doesn't really exist as a static file.
Marked as answer by Dino He - MSFT on May 17, 2012 02:24 AM
mcleanap
Member
11 Points
105 Posts
Write access on root
May 10, 2012 10:59 PM|LINK
I would like users to be able to create a sitemap.xml file on the fly and store it in the root. I don't really want to give write permissions on the root folder.
Is there a way to do this?
dahla
Participant
1816 Points
369 Posts
Re: Write access on root
May 10, 2012 11:32 PM|LINK
Instead of creating sitemap.xml files pr. user it would probably be a better idea to implement a sitemap provider reading i.e. from a database.
When implementing af sitemap provider you can easily vary the content based on how is logged in.
You can find a basic example for a sitemapprovider giving a static sitemap here
mcleanap
Member
11 Points
105 Posts
Re: Write access on root
May 11, 2012 12:39 AM|LINK
Thanks. I was referring to a google sitemap.xml file that is generated based on URLs that are generated from a SQL Server database. I have a stored proc that basically returns records containing
loc
lastmod
changefreq
priority
necro_mancer
Star
8089 Points
1590 Posts
Re: Write access on root
May 11, 2012 01:03 AM|LINK
hi there,
based on your requirement, you have to always give the write permission to generate the intended sitemap.xml.
Please mark this response as an "answer" if it helps you. Thanks heaps!
Professional SQL 2008 R2 Service
dahla
Participant
1816 Points
369 Posts
Re: Write access on root
May 14, 2012 06:24 PM|LINK
I agree with necro_mancer. You can use the location element to provide the permissions specifically
mcleanap
Member
11 Points
105 Posts
Re: Write access on root
May 14, 2012 06:28 PM|LINK
I ended up rendering the file on the fly using FileStreamResult. Sitemap.xml or sitemap.xml.gz can always be found even though it doesn't really exist as a static file.