"this file is locked because it appeared from another computer" - ajax resolution problem

I am compiling a local XML file using jQuery ajax via html, which I download from my site.

The problem is that every time a file is downloaded, the user must right-click on it → properties → unblock. Otherwise, jquery ajax throws a "refused permission" error.

Is it possible to mark a file as trusted or something similar? Do I have to implement something on the server when uploading a file? Or add something on the client side to the saved html file? Thanks in advance.

+5
source share
3 answers

NTFS . Sysinternals Streams . :

http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx

, Process class, streams -d <file.xml>, , . :

Process runcommd = new Process();

runcommd.StartInfo.FileName = "streams";
runcommd.StartInfo.Arguments = " -d \"fullpath\\file.xml\"";

runcommd.StartInfo.UseShellExecute = false;
runcommd.StartInfo.CreateNoWindow = false;

runcommd.StartInfo.RedirectStandardError = true;
runcommd.StartInfo.RedirectStandardOutput = true;
runcommd.StartInfo.RedirectStandardInput = true;

// now run it
runcommd.Start();

// be sure that we end
runcommd.StandardInput.Flush();
runcommd.StandardInput.Close();

- MS, , . , .

: https://superuser.com/questions/38476/this-file-came-from-another-computer-how-can-i-unblock-all-the-files-in-a

http://www.k9ivb.net/files/This%20file%20came%20from%20another%20computer%20and%20might%20be%20blocked.pdf

+6

@Aristos , EXE (streams.exe). , , (AFS):

echo. > my_blocked_file.zip:Zone.Identifier

, my_blocked_file.zip AFS. , dir /r, AFS notepad my_blocked_file.zip:Zone.Identifier, .

:

[ZoneTransfer] 
ZoneId=3

: http://msdn.microsoft.com/en-us/library/ff469212(v=prot.10)

:

  • : ZoneId = 1
  • : ZoneId = 2
  • : ZoneId = 3
  • : ZoneId = 4

, IE , , AFS / , , , IE, AFS.

+1

. regedit /:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments\SaveZoneInformation

1 , . , , , HKCU. , , .

0

All Articles