Hi Zeeshan Ahmed,
I read about using ACCEPT attribute for restricting contenttypes. It all said you should set
enctype="multipart/form-data" in <form> tag and use ACCEPT attribute of FILE control to restrict the type of files to be uploaded. But I have not found any example supporting that yet. Common content types used with ACCEPT atribute are - text/html, image/jpeg, model/vrml, video/quicktime, application/java, text/css, and text/javascript.
After a lot of search on that, have never got through successfully yet, instead used client -side scripting to restrict that as some sites recommended.
You can try this example to see how that works.
Code:
<script type="text/javascript" language="JavaScript">
function check() {
var ext = document.f.pic.value;
ext = ext.substring(ext.length-3,ext.length);
ext = ext.toLowerCase();
if(ext != 'jpg') {
alert('You selected a .'+ext+
' file; please select a .jpg file instead!');
return false; }
else
return true; }
</script>
<form method="post" name=f enctype="multipart/form-data" onsubmit="return check();" action="">
<p>
Please select a JPEG (.jpg) file to be sent:
<br>
<input type="file" name="pic" size="40" accept="image/jpeg">
<p>
Please include a short explanation:<br>
<textarea name="expl" rows="3" cols="40" onfocus="check();">
</textarea>
<p>
<input type="submit" value="Send">
</form>
Can try that modifed for SWF.
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection