ASP Mobile file function MoveFile the substitution of insufficient authority-application tips

Source: Internet
Author: User

These days to do a project, is to write a statement, the D-disk files all moved to the E disk, in the local XP environment test is very good.

However, after you put it on the Windows 2003 server, you are prompted for insufficient permissions.

My IIS Web site directory in D, and E is just a new volume, some files are very large and many, but d not enough to use, so out of this unwise.

Baidu a bit, a lot of such problems, but is to increase the permissions of e-disk, or the E-disk as a virtual directory.

But it doesn't work, so remind, the only difference is that I use dynamic volume, and XP is the basic volume, I do not want to change the volume plate.

Finally found the following approach:

With the FSO MoveFile will appear insufficient permissions, so the code can not be executed.
So using CopyFile and deletefile to avoid unnecessary trouble.

That

Copy Code code as follows:

Set fso=createobject ("Scripting.FileSystemObject")
Fso. MoveFile "File path", "Target"

There is a problem with this.

Use:

Copy Code code as follows:

Set fso=createobject ("Scripting.FileSystemObject")
Fso. CopyFile "File path", "Target"
Fso. DeleteFile "File path"

So decisively solved the problem. Replication can not be moved.

4.30 Update

Later, Tinker, the original is not the issue of e-disk permissions, but the issue of D-disk permissions, that is, IIS Web site Directory permissions.

Add the Internet Guest account to D, plus an account that starts with IUSR_, which is an IIS account.

Then use the MoveFile and it's no problem.

If you want to move or delete a file, you should first check the source file's permissions, not the target file's permissions.

Online tutorials are really harmful.

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.