Differentiate the Flash request and the request from the address bar of the browser,

Hi, I am trying to prevent the download of mp3 songs, so I want to ask you guys if it is possible to distinguish between a Flash request and regular HTTP requests, I checked the $ _SERVER variable, but could not find any difference, what am I doing? any solutions please

+3
source share
2 answers

No, when you use the Flash methods getURL or navigateToUrl, it sends a regular http packet that you cannot distinguish from normal browser requests.

SWF , ., SWF , , - , Apache .htaccess.

EDIT: , SWF .

var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(whatever_url);
request.requestHeaders.push(new URLRequestHeader("pragma", "no-cache"));
request.requestHeaders.push(new URLRequestHeader("Expires", "Thu, 01 Jan 1970 00:00:00 GMT, -1"));
request.requestHeaders.push(new URLRequestHeader("Cache-Control", "no-cache, no-store, must-revalidate"));
loader.load(request);

, , SWF .

+1

, , . , , .

: mp3 (,/MySongs/song.mp3) - , URL- , GetSong.php?songname=song3

, .

: , /MySongs/song.mp3 . , . , .

:, , -, , Session ( PHP) . , .

: GetSong.php , , , .

, , , , , , , , Flash .

+1

Source: https://habr.com/ru/post/1778710/


All Articles