# Uploading images in flash

**URL:** <https://forum.kirupa.com/t/uploading-images-in-flash/127691>\
**Category:** Uncategorized\
**Created:** [November 5, 2004, 5:03am UTC](https://forum.kirupa.com/t/uploading-images-in-flash/127691 "2004-11-05T05:03:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bananha](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@bananha](https://forum.kirupa.com/u/bananha)\
**Post date:** [November 5, 2004, 5:03am UTC](https://forum.kirupa.com/t/uploading-images-in-flash/127691/1 "2004-11-05T05:03:34Z")

</div>

so i’m attempting to use a javascript hack to generate the browse and upload action in order to upload images while using a flash interface…

my problem is getting it all to work together. any thoughts ?

here’s the javascript:

function SetTheFilename()  
{ parent.hidden.document.myForm.file.click();  
while(parent.hidden.document.myForm.file.value == “”)  
{ window.setTimeout(100);  
}  
parent.hidden.SendTheFilenameToFlash();  
}  
function SubmitTheFile()  
{ if (parent.hidden.document.myForm.file.value=="")  
{ alert(“Please enter a valid filename”);  
}  
else  
{ alert("Submitting " + parent.hidden.document.myForm.file.value);  
parent.hidden.document.myForm.submit();  
}  
}

here’s the code in flash:

// Call browse method associated with HTML file widget  
myBrowse.onRelease = function()  
{ getURL(“javascript:SetTheFilename();”);  
};

// Submit the file upload  
mySubmit.onRelease = function()  
{ getURL(“javascript:SubmitTheFile();”);  
};
