Sandbox security violation

9 views
Skip to first unread message

visualcpp

unread,
May 16, 2009, 5:38:02 AM5/16/09
to masapi
Hi
I am trying to use the masapi library to download files from another
domain, my flash is on www.mydomain.com and I am trying to download a
file from www.anotherdomain.com I get a "SandBox security Violation"?

Is there a way to avoid this?

Thank you

Cédric Tabin

unread,
May 16, 2009, 5:50:33 AM5/16/09
to mas...@googlegroups.com
Hello,

This isn't an issue due to Masapi, but from the Flash Player Security Sandbox. You can bypass that using the Security class :
- http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.html#allowDomain()
- http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.html#allowInsecureDomain()

Best regards,
Cedric

visualcpp

unread,
May 16, 2009, 6:04:16 AM5/16/09
to masapi
Thank you

I taked a look to the security class, but it's not solving my problem,
I see that there are many plugins and software that download flv
videos from youtube like sites?
this cannot be done with flash?
The security Sandbox make that impossible?

Thank you again


On May 16, 11:50 am, Cédric Tabin <tabin.ced...@gmail.com> wrote:
> Hello,
>
> This isn't an issue due to Masapi, but from the Flash Player Security
> Sandbox. You can bypass that using the Security class :
> -http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...()
> -http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...()
>
> Best regards,
> Cedric
>
> On Sat, May 16, 2009 at 11:38 AM, visualcpp <khkas...@gmail.com> wrote:
>
> > Hi
> > I am trying to use the masapi library to download files from another
> > domain, my flash is onwww.mydomain.comand I am trying to download a
> > file fromwww.anotherdomain.comI get a "SandBox security Violation"?

Cédric Tabin

unread,
May 16, 2009, 6:15:32 AM5/16/09
to mas...@googlegroups.com
Hi,

What's the code you're using ??? You may put an xml file on the host allowing your site to download your files...

Regards,
Cedric

visualcpp

unread,
May 16, 2009, 6:25:32 AM5/16/09
to masapi
Hi,
There are sites like keepvid.com, where you can type the youtube link
of a site, and you get a download link to download the file, I am
trying to download this file using Flex

private var cml:CompositeMassLoader;
public function DownloadFile(videoURL:String):void
{
//Security.allowDomain("http://keepvid.com");
cml = new CompositeMassLoader();
cml.massLoader.useCache = true;
cml.addFile(videoURL,LoadableFileType.BINARY);
cml.massLoader.addEventListener(ProgressEvent.PROGRESS,
handleProgress);
cml.massLoader.addEventListener(Event.COMPLETE, handleComplete);
cml.start();
}

private function handleProgress(evt:ProgressEvent):void
{
var infos:ILoadInfo = cml.massLoader.loadInfo;
//var infos:ILoadInfo = evt.target.loadInfo; <-- aussi possible

trace("ratio : "+infos.ratioLoaded);
trace("pourcentage : "+infos.percentLoaded);
trace("vitesse : "+infos.currentSpeed);
trace("vitesse moyenne : "+infos.averageSpeed);
trace("temps écoulé : "+infos.elapsedTime);
trace("temps restant (estimé) : "+infos.remainingTime);
trace("bytes chargés : "+infos.bytesLoaded);
trace("bytes total : "+infos.bytesTotal);
trace("bytes à charger : "+infos.bytesRemaining);
}

private function handleComplete(event:Event):void
{
var file2:ILoadableFile = cml.getFileAt(0);
var ldr:ByteArray = file2.getData();
if(ldr != null)
trace("taille du fichier " + ldr.length);
}

and I am calling :
DownloadFile("http://keepvid.com/save-video.flv?http%3A%2F
%2Fv4.lscache8.googlevideo.com%2Fvideoplayback%3Fsparams%3Did
%252Cexpire%252Cip%252Cipbits%252Citag%26itag%3D5%26ip
%3D174.37.202.98%26ipbits%3D0%26sver%3D3%26expire%3D1242489600%26key
%3Dyt1%26signature
%3D77EB2BF84D4FEEBBDAD1B5DB2A5D91BDFD0BE867.C43A9A889D23B4B6F11581873A0EFFD03C129F2E
%26id%3D90f952dc07400cab");

so I get a sandbox violation erro

Thank you


On May 16, 12:15 pm, Cédric Tabin <tabin.ced...@gmail.com> wrote:
> Hi,
>
> What's the code you're using ??? You may put an xml file on the host
> allowing your site to download your files...
>
> Regards,
> Cedric
>
> On Sat, May 16, 2009 at 12:04 PM, visualcpp <khkas...@gmail.com> wrote:
>
> > Thank you
>
> > I taked a look to the security class, but it's not solving my problem,
> > I see that there are many plugins and software that download flv
> > videos from youtube like sites?
> > this cannot be done with flash?
> > The security Sandbox make that impossible?
>
> > Thank you again
>
> > On May 16, 11:50 am, Cédric Tabin <tabin.ced...@gmail.com> wrote:
> > > Hello,
>
> > > This isn't an issue due to Masapi, but from the Flash Player Security
> > > Sandbox. You can bypass that using the Security class :
> > > -
> >http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...()<http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...>
> > > -
> >http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...()<http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...>
>
> > > Best regards,
> > > Cedric
>
> > > On Sat, May 16, 2009 at 11:38 AM, visualcpp <khkas...@gmail.com> wrote:
>
> > > > Hi
> > > > I am trying to use the masapi library to download files from another
> > > > domain, my flash is onwww.mydomain.comandI am trying to download a
> > > > file fromwww.anotherdomain.comIget a "SandBox security Violation"?

Cédric Tabin

unread,
May 16, 2009, 6:28:10 AM5/16/09
to mas...@googlegroups.com
Hi,

You're loading a flv, so you will need to put a domain.xml (or cross-domain.xml I don't know exactly) on keepvid.com to allow your site to access the files, otherwise you will be unable to reach them (or you can use a hack with php, but you won't be able to have the streaming...)

Regards,
Cedric
Reply all
Reply to author
Forward
0 new messages