The impact of temp folder permissions on ASP websites and ASP. NET websites

Source: Internet
Author: User

For websites and security purposes, permission assignment is not required. Website permissions are generally directly set the virtual directory where the site is located, that is, adding an Internet Guest account to the security of the virtual directory, and assign all permissions except full control; If yes. net, must also be added to ASP.. Net user configuration except for full control!

Under normal circumstances, it will be OK, and the general website on the server can run normally! However, I found that the permission assignment for the temporary C \ windows \ Temp folder also affects the website's successful operation!

But there were two situations a few days ago:

I. asp site:
Make a version of the poly website, strawSource codeWhen I came over to test, I couldn't connect to the database. I thought the database was connected.CodeAn error occurred, so the test at failed. After running the test, no error was found! The Code is as follows:

<%
DB = "INC/xxx. asp"
Connstr = "provider = Microsoft. Jet. oledb.4.0; Data Source =" & server. mappath ("" & dB &"")
On Error resume next
Set conn = server. Createobject ("ADODB. Connection ")
Conn. connectiontimeout = 10
Conn. Open connstr
If conn. errors. Count <> 0 then
Conn. Close
Set conn = nothing
Response. Write "<font size = 2 color = Red> database connection error. Check the connection string. </Font>"
Response. End
End if
%>

But it always shows: database connection error, please check the connection string. I tried for more than two hours, no error found! Later, I remembered that the backend could not be accessed because the temp permission was not granted. So I tried to give the read/write attribute of everyone! So suddenly OK ~

Ii. ASP. NET site:
After graduation, the following error suddenly occurred:
Cs0016: failed to write the output file "C: \ WINDOWS \ XXX directory \ XXX. dll" -- "Access denied ."

Reference compiler error message: cs0016: cocould not write to output file 'C: \ windows \ Microsoft. net \ framework \ v2.0.50727 \ temporary ASP. net files \ Root \ 80940643 \ 9a3d5a0a \ app_web_index.aspx.cdcab7d2.p7p862zk.dll '-- 'Access is denied. '

A very depressing check error occurs. Check the Web. config file and you will not feel any problems! Later I saw this article on csdnArticleThe solution is to add the network service user to the temp Security tab of the Temporary Folder under the Windows directory and grant full permissions.

Cold, try it. It's done!

in short, the temp temporary directory permission is really important, so write it down in the blog. If there is an inexplicable error, remember to give the temp folder the permission!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.