# Monitoring getUrl()

**URL:** <https://forum.kirupa.com/t/monitoring-geturl/61185>\
**Category:** flash\
**Created:** [August 16, 2004, 8:27pm UTC](https://forum.kirupa.com/t/monitoring-geturl/61185 "2004-08-16T20:27:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![penmig](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/penmig/32/167_2.png) [@penmig](https://forum.kirupa.com/u/penmig)\
**Post date:** [August 16, 2004, 8:27pm UTC](https://forum.kirupa.com/t/monitoring-geturl/61185/1 "2004-08-16T20:27:34Z")

</div>

HI, I’ve some links to permit the visitor to download documents (zip files) from the server, I need to trigger if the file doesn’t exist to send him an alert but seems that the function getUrl() can’t have listeners or handlers.

Anybody knows how can I do it ?

Thanks and have a nice day :sigh:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 16, 2004, 11:24pm UTC](https://forum.kirupa.com/t/monitoring-geturl/61185/2 "2004-08-16T23:24:39Z")

</div>

> [@penmig](#):
>
> HI, I’ve some links to permit the visitor to download documents (zip files) from the server, I need to trigger if the file doesn’t exist to send him an alert but seems that the function getUrl() can’t have listeners or handlers.
> 
> Anybody knows how can I do it ?
> 
> Thanks and have a nice day :sigh:

look into XMLSocket

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 16, 2004, 11:38pm UTC](https://forum.kirupa.com/t/monitoring-geturl/61185/3 "2004-08-16T23:38:20Z")

</div>

The “easiest” is using sockets, but that might get heavy on the server if you have heavy traffic on your site. another way to do this is setting a timeout period.  
Make an object that will load the target, and check to see if the target is loading (by checking if the totalBytesLoaded is greater than 4). If after X seconds (usually 4-7) it’s still 4 or lower, than it is not loading, and you can do whatever it is you want to do in that case.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2004, 5:27am UTC](https://forum.kirupa.com/t/monitoring-geturl/61185/4 "2004-08-17T05:27:39Z")

</div>

Thanks for the info JakeO & deQue

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2004, 5:39am UTC](https://forum.kirupa.com/t/monitoring-geturl/61185/5 "2004-08-17T05:39:07Z")

</div>

an easy way to do this would be to make a php or asp download handler script. Therefore you could track how many times the file has been downloaded as well and store it in a database.

The way you would do this is do something like:

download.php?d=http://dljafjd.com/file.zip

then pass that string in the php file and redirect when your finished with the script. if the file doesnt exist it could take you to a “file not found” page.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2004, 12:17pm UTC](https://forum.kirupa.com/t/monitoring-geturl/61185/6 "2004-08-17T12:17:23Z")

</div>

Thanks MissionSix !!!
