How to get full URL when LoaderInfo.isURLInaccessible == true?
Why is Flash Security so hard to figure out?
I am trying to load an image; however, the image URL I 1st receive is actually a redirected URL. I wish to load the redirected URL, but I can't get the full redirected URL because LoaderInfo.isURLInaccessible is true even though I think I follow all the precautions detailed on the following page:
http://www.macromediademos.com/devnet/flashplayer/articles/fplayer10.1_air2_security_chang es.html
Here is my sitaution...
I have an image URL: i.e. "http://www.foo.com/image.jpg"
I attempt to load the image ensuring that I set the LoaderContext's checkPolicyFile to "true"
var ur:URLRequest = new URLRequest( "http://www.foo.com/image.jpg");
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
var lc:LoaderContext = new LoaderContext();
lc.checkPolicyFile = true;
l.load(ur, lc);
When the Event.COMPLETE is dispatched, I discover that the loaded image's URL is not the one I first used ( "http://www.foo.com/image.jpg") instead the URL is a redirected URL "http://www.bar.com/image.jpg".
Because of sandbox issues, I can not use the loaded image and be able to manipulate the image. So instead I need to reload the image using the final URL. However, I cannot determine what the redirected URL is because the LoaderInfo.isURLInaccessible == true and LoaderInfo.url =="http://www.bar.com/", not "http://www.bar.com/image.jpg".
private function onLoad(e:Event):void {
var li:LoaderInfo = LoaderInfo(e.target);
trace("isURLInaccessible = " + li.isURLInaccessible); //output = "isURLInaccessible = true"
trace("li.url = " + li.url); //output = "li.url = http://www.bar.com/"
Acording to the Adobe Blog post (see URL above), I need to ensure two things: 1) LoaderContext.checkPolicyFile= true, and 2) the crossdomain policy file gives the proper permission.
I think I've met both o these criteria. The crossdomain file for BOTH http://www.foo.com/crossdomain.xml and http://www.bar.com/crossdomain.xml is the following:
<cross-domain-policy>
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="all"/>
</cross-domain-policy>
What am I doing wrong? How do I ensure that I can get the redirected URL and LoaderInfo.isURLInaccessible == false?
thanks!
Here's an update. (though still no solution.)
1) I preloaded ANY image from the redirected server: i.e. http://www.bar.com/image123.jpg. (Mind you, I did nothing with this preloaded image.) When I loaded this image, checkPolicyFile == true.
2) A few seconds later, I loaded the desired non-redirected image: http://www.foo.com/image.jpg.
3) This time, isURLInaccessible was true and I had access to the full redirected URL: i.e. http://www.foo.com/image.jpg.
Please note that the image from the 1st step didn't have to be the same image from the 3rd step.
It appears that you have to check the policy file on the redirected URL before have knowledge of the redirected URL. However, how can you check the policy file on the redirected URL if you don't know the redirected URL yet?
Ah, Adobe Flash security makes so much sense and is always so simple. /sarcasm
So does anyone know how to properly check the policy file for redirected images with this new info?
Seemingly according to the security page written by Adobe which I linked to my 1st post, it should be as simple as setting the checkPolicyFile property of the LoaderContext. I've tried that and that doesn't work. So either Adobe's page is incorrect (perhaps) or is not clear (most likely).
Unless anyone can come up with a simpiler way to do this, I'll probably do the following which theoretically should work:
1) load the non-redirected image
2) when image loads, determine if the loaded URL == the URL originally used to load the image
3) If it is determined that the loaded URL is a redirected URL, then check if isURLInaccessible == true.
4) if isURLInaccessible == true, then somehow load the policy file from the incomplete URL (I will need to figure out how to do this.)
5) Once the policy file loads, then go back to step #1. When the process reaches step #4, then isURLInaccessible should be false at which case, process to step #6
6) Load the redirected image URL
The above seems like a lot steps to load an image. Can someone confirm if the above is necessary or if there is a simpler way to load the redirected image's policy file?
Similar Messages
-
How to get full url using UCM RIDC api
Hi,
I am using RIDC api to get the full url of the document (including protocol, host, port info). I tried using DOC_INFO
and GET_SEARCH_RESULTS api. The GET_SEARCH_RESULTS api returns the path but no protocol, host, port info.
DOC_INFO does not contain any uri. Is there a way to get full url? I only have access to the idc socket connection
configuration to connect to the server.
E.g. I know the idc connection url is idc://hostname:4444
The user supplies document name as "myDoc.txt" and dId = 2000.
I used GET_SEARCH_RESULTS for myDoc.txt and DOC_INFO for dId=2000.
I need to return absolute url to the user that user can copy paste in the browser and download the doc.
Thanks,
--dhirajYou can ge the docUrl using doc info services DOC_INFO or DOC_INFO_BY_NAME.
dataBinder.putLocal("IdcService", "DOC_INFO");
dataBinder.putLocal("dID", docId);
ServiceResponse response = idcClient.sendRequest (idcContext, dataBinder);
DataBinder respBinder = response.getResponseAsBinder();
System.out.println("DocUrl"+ respBinder.getLocal("DocUrl")); -
How to get full URL in java?
Hi,
I am working in a spring & hibernate project. For the AJAX request to bookmark, I used RSH (Really Simple Framework) framework. So, my URL changes for the AJAX request as
http://localhost:8080/courses#/medicaltranscription/cardiology
If I bookmark this and open in a new window, I cant get full URL in Servlet. If I use methods in Servlet, it gets only, upto http://localhost:8080/courses. I cant get the whole URL. Please, help me to find a solution.
Thank youThe hash part is entirely client side. You cannot get it on the server side. You need to pass it as request parameter or as part of real URL.
-
Hi,
I have requirement in Sp Designer 2010,Get List item URL and insert in another list as one column value.When open another list and click on same item column entry url will show the parent item information.
Here i have create work flow and insert item URL in another list but cant find appropriate item url information.I can easily make item url link through String builder in mail body with using current id and predefine link,but
when try to insert the same type of item link in another list where i cant find string builder for create custom url link,only get valur of Path,URL,Absolute URL and Relative server URL,all these links or not provide me exact
item link dispaly information.
So I opened SharePoint Designer and start creating the workflow associated to the list.
As there is some Field from source related to current item URL I start using it
Encoded Absolute URL – this one should be the one to use
Server Relative URL
URL Path
Unfortunately, none of these options were providing the correct link. Indeed, these options are providing an incorrect path:
Encoded Absolute URL
http://wfe1/Lists/bpf/1_.000
Server Relative URL
/Lists/bpf/1_.000
URL Path
/Lists/bpf/1_.000
As you can see, the item URL is composed by an ID while it should be http://wfe1/Lists/bpf/dispform.aspx?id=1
Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Share Point Application Developer,TCSUnfortunately, [%Current Item:URL%] doesn't seem to be available from a "Site Workflow" associated to a List. I'm finding less advantages to doing a "Site Workflow" when I don't necessarily need to. One problem is the workflow is initiating
twice. I'm thinking I should have just created the workflow as a a "List Workflow."
I am going to try "Association Columns" -- that may work. Anyone have other suggestions? -
Xml: how to get node value when pasing node name as a parameter
Hi,
I've got some xml:
var xmlData:XML =
<1stNode>
<buttonID>first child node value</buttonID>
<imageID>second child node value</imageID>
<labelID>third child node value</labelID>
</1stNode>
Then I want to read specific node value based on a value passed to a function. .
var buttonID = new Button;
var imageID = new Image;
var labelID = new Label;
getNodeValue(buttonID); //the value here is set dynamically
private function getNodeValue (nodeName:String):void {
trace (xmlData.nodeName) //doesn't work
var str:String = "xmlData." + nodeName;
var xml:XMLList = str as XMLList //doesn't work
I'm don't know how to get the value when node name is dynamically changed.use:
getNodeValue(buttonID); //the value here is set dynamically
private function getNodeValue (nodeName:String):void {
trace (xmlData[nodeName]) -
How to get the path when i select a directory or a file in a JTree
How to get the path when i select a directory or a file in a JTree
import java.lang.*;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.HeadlessException;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Iterator;
* @author Frederic FOURGEOT
* @version 1.0
public class JTreeFolder extends JPanel {
protected DefaultMutableTreeNode racine;
JTree tree;
protected JScrollPane scrollpane;
final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
* Sous-classe FSNode
* @author Frederic FOURGEOT
* @version 1.0
private class FSNode extends DefaultMutableTreeNode {
File file; // contient le fichier li� au noeud
* Constructeur non visible
private FSNode() {
super();
* Constructeur par initialisation
* @param userObject Object
FSNode(Object userObject) {
super(userObject);
* Constructeur par initialisation
* @param userObject Object
* @param newFile File
FSNode(Object userObject, File newFile) {
super(userObject);
file = newFile;
* Definit le fichier lie au noeud
* @param newFile File
public void setFile(File newFile) {
file = newFile;
* Renvoi le fichier lie au noeud
* @return File
public File getFile() {
return file;
public JTree getJTree(){
return tree ;
* Constructeur
* @throws HeadlessException
public JTreeFolder() throws HeadlessException {
File[] drive;
tree = new JTree();
// cr�ation du noeud sup�rieur
racine = new DefaultMutableTreeNode("Poste de travail");
// cr�ation d'un noeud pour chaque lecteur
drive = File.listRoots();
for (int i = 0 ; i < drive.length ; i++) {
FSNode node = new FSNode(drive, drive[i]);
addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
racine.add(node);
// Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
tree.addTreeExpansionListener(new TreeExpansionListener() {
public void treeExpanded(TreeExpansionEvent e) {
// lorsqu'un noeud est ouvert
// on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
TreePath path = e.getPath();
FSNode node = (FSNode)path.getLastPathComponent();
addFolder(node);
((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
public void treeCollapsed(TreeExpansionEvent e) {
// lorsqu'un noeud est referm�
//RIEN
// alimentation du JTree
DefaultTreeModel model = new DefaultTreeModel(racine);
tree.setModel(model);
setLayout(null);
// ajout du JTree au formulaire
tree.setBounds(0, 0, 240, 290);
scrollpane = new JScrollPane(tree);
add(scrollpane);
scrollpane.setBounds(0, 0, 240, 290);
* Recuperation des sous-elements d'un repertoire
* @param driveOrDir
* @param node
public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
addFolder(driveOrDir, node, 0);
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Recuperation des sous-elements d'un repertoire
* (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
* @param driveOrDir File
* @param node DefaultMutableTreeNode
* @param level int
private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
File[] fileList;
fileList = driveOrDir.listFiles();
if (fileList != null) {
sortFiles(fileList); // on tri les elements
// on ne cherche pas plus loin que le niveau maximal d�finit
if (level > MAX_LEVEL - 1) {return;}
// pour chaque �l�ment
try {
for (int i = 0; i < fileList.length; i++) {
// en fonction du type d'�l�ment
if (fileList[i].isDirectory()) {
// si c'est un r�pertoire on cr�� un nouveau noeud
FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
node.add(dir);
// on recherche les �l�ments (r�cursivit�)
addFolder(fileList[i], dir, ++level);
if (fileList[i].isFile()) {
// si c'est un fichier on ajoute l'�l�ment au noeud
node.add(new FSNode(fileList[i].getName(), fileList[i]));
catch (NullPointerException e) {
// rien
* Recuperation des sous-elements d'un noeud
* @param node
public void addFolder(FSNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
for (int i = 0 ; i < node.getChildCount() ; i++) {
addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Tri une liste de fichier
* @param listFile
public void sortFiles(File[] listFile) {
triRapide(listFile, 0, listFile.length - 1);
* QuickSort : Partition
* @param listFile
* @param deb
* @param fin
* @return
private int partition(File[] listFile, int deb, int fin) {
int compt = deb;
File pivot = listFile[deb];
int i = deb - 1;
int j = fin + 1;
while (true) {
do {
j--;
} while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
do {
i++;
} while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
if (i < j) {
echanger(listFile, i, j);
} else {
return j;
* Tri rapide : quick sort
* @param listFile
* @param deb
* @param fin
private void triRapide(File[] listFile, int deb, int fin) {
if (deb < fin) {
int positionPivot = partition(listFile, deb, fin);
triRapide(listFile, deb, positionPivot);
triRapide(listFile, positionPivot + 1, fin);
* QuickSort : echanger
* @param listFile
* @param posa
* @param posb
private void echanger(File[] listFile, int posa, int posb) {
File tmpFile = listFile[posa];
listFile[posa] = listFile[posb];
listFile[posb] = tmpFile; -
I cannot see my Iphone 4 in my device window in the finder anymore. It use to appear so I could copy the camera pictures off of it and transfer them to other folders. Does anyone have and idea how to get it back when you plug it in initially. Thanks
You will want to open iPhoto, go to the iPhoto menu and select Preferences. Under the General tab, next to Connecting camera opens: select iPhoto. Close the preferences and quit iPhoto. Reconnect your iPhone 4. iPhoto should open automatically and offer to import your pictures. Import them and then do what you want with them.
Best of luck. -
How to get full file path while uploading a file in flex Applications
How to get full file path while uploading a file in flex applications.
FileReference Object is giving file name and other details but not the actual path.
Is there any workaround to to get the file path?.
ThanksWhy not ask in the Flex forum; it is more likely that someone over there knows.
-
How to get full screen caller pic in ios 7.1
How to get full screen caller pic in ios 7.1.Please help me
Haha .. I have seen one million post on this issue since 7.1 was released. Everybody hates it and it is perhaps Apple's stupidest design decision. I, personally, happen to like it ... or not mind it as much either way, I should say.
But that's not what you asked ... Apple thought it was best for some odd reason to change the full screen pics to an itty bitty circle. As a previous poster said, it cannot be changed. But be sure to go to Apple's feedback website and let them know you are unhappy about it. I sense an iOS 7.1.1 coming out REAL soon! -
How to get a confirmation when your email is delivered or read ?
With Mail app ,How to get a confirmation when your email is delivered or read?
When I send mail with Mail app , there is flying letter pops up. But now I could not see anymore. Do you know how can I active that animation ?
Thanks for your help -
How to get the tab when is it pressed?
I have the following situation:
I have an array of JTextField inside a scroollpane. The size of my array is nine or ten depends on some rules. But my window show just four JTextField. So I would like to know how to get the event when I press "tab", just to show the others JTextField while I'm pressing "tab". Because I need this event to scrooll down or scrooll up.
I tried the keylistener, but when I press "tab" any method(keypressed, keyreleased, keytyped) is called.
I also tried the focuslistener. If this event I could scrooll down or scrooll up, but I couldn't do both!!
Can somebody help me??
Thanks anyway!!
GinJTextField implements Scrollable interface, which provides information to the enclosing container such as JScrollPane.
Hence when the tab event is fired, you can compute the Rectangle area that should be visible and then call the 'scrollRectToVisible()' method in JTextField. This will inform the JScrollPane to scroll to the rectangle that you mention.
HTH -
Hallo,
In my Dynpage portal application.I use 3 Jsp's.One of the Jsp having a Iframe element.This iframe source is an External HTTP address.In the source tag i have to supply the Results frame as some Iframe name and result-url as my 3rd jsp url,so that i can unpack the XML and process the data.
All the 3 Jsp's are in /pagelet/ folder.Does anybody know how to get the url for the Jsp inside the pagelet folder.
Further more pagelet folder is private folder,will it be a problem for the external website to post the result to this private /pagelet/3rd.jsp.
Example src tag for Iframe
http://demo.mygraphics.nl/nbgint/NBG_INT_main.asp?action=CHART&datas
ource=NBGMV&product=INTERNET&size_x=300&size_y=300&result_frame=Results&
result_url="Here i have to give my 3rd jsp url"&defa
ult_centre_x=256000&default_centre_y=471000&default_width=0.5Hi gaurav,
You are right,it is Jspdynpage.I have already read about the Urlgenerator that it can generate url's only for components and pages.So i have created 2 components in one PAR but havent tested yet.
Anyway thanks for your reply.
I have tested it and it works fine.Here is the code
try {
IUrlGeneratorService urlGen = (IUrlGeneratorService) PortalRuntime.getRuntimeResources().getService(IUrlGeneratorService.KEY);
IPortalUrlGenerator portalGen = null;
ISpecializedUrlGenerator specUrlGen = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
if (specUrlGen instanceof IPortalUrlGenerator) {
portalGen = (IPortalUrlGenerator) specUrlGen;
// generate Component Url
try {
String url = null;
url = portalGen.generatePortalComponentUrl(request,"NewUrlProj.NewUrlComp");
HttpServletRequest srq = request.getServletRequest();
String vorUrl = srq.getScheme()"://"srq.getServerName()":"srq.getServerPort();
myBean.setUrl(vorUrl+url);
} catch (NullPointerException e) {
myBean.setErrorMsg("Unexpected Nullpointer. This should not happenend, but it did! Something must have gone wrong :-(");
catch(Exception e){
myBean.setErrorMsg(e.getLocalizedMessage());
Message was edited by: Baskaran Senthivel -
How to get an email when data got inserted
Hi All,
Could you please let me know how to get an email when data got inserted into table by using sql/plsql
Thanks in adavanceCould you please let me know how to get an email when data got inserted into table by using sql/plsql
Well that seems pretty straightforward - write some pl/sql to send you an email when that pl/sql inserts data into a table.
See this Oracle-base article for an example of sending mail.
http://www.oracle-base.com/articles/misc/email-from-oracle-plsql.php
Post what you have tried so far. What part of what you have tried doesn't seem to be working? -
Why can't I get full screen when in Safari since I downloaded ios8
WWhy since I downloaded ios8 can't I get full screen when in safari
Have you tried tapping the blue bookmark icon on top left of screen?
-
HT4061 how to get full info about the iphone by putting the imei number in pc
how to get full info about the iphone by putting the imei number in pc
https://discussions.apple.com/message/23921736#23921736
Maybe you are looking for
-
CX_SY_FILE_OPEN_MODE - short dump on production but not in Dev and Test
Hello, I'm getting the follwoing short dump in production when I run the program which writes the data to application server. I have open data set and close data set. Same program when I in development and test I do not get any short dump. Can any kn
-
How to get the date of Friday for the given week
HI, I have a requirement to get the date of Friday for the given week. Eg: I have an input of 200722 (Yearweek), From this I need to get the Date of the friday for this week 22 of Year 2007. Plz let me know how to get this.. Thanks in advance.. Sridh
-
How do I get rid of double entries in my Contacts?
I sync a 3rd party software, DejaOffice, from my iPad to my PC via Outlook. (DejaOffice is an integrated program with Calendar, Contacts, To-do List, and other features.) DejaOffice allows for syncing to Apple Calendar & Contacts. (Synicing to Contac
-
Everything in the tray disappeared...
All indicators in my top right corner tray disappeared. What can I do?
-
Hi experts! I need an immediate help from u guys. Can anyone tell me how to create documents and save it in BW STD. documents. Does that mean to save it in microsoft word or pdf file?and somehow connect it to bw? actually i am working on a higher edu