dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] Restricting Image Upload type to .jpg only

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    14

    [F8] Restricting Image Upload type to .jpg only

    Hi there,

    I am currently in the process of creating a simple file upload application in Flash and need to know how to restrict the file type that can be selected to only .jpg ...

    Does anyone know how to achieve this? Currently all image files are selectable (.gif, .jpg, .png). Thanks in advance!

    Luke

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Check the doc's about using the file upload class. You will see a paragraph about setting allowed file types
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    you would use something similiar to -
    PHP Code:
    import flash.net.FileReferenceList;

    var 
    allTypes:Array = new Array();
    var 
    imageTypes:Object = new Object();
    imageTypes.description "Images (*.JPG;)";
    imageTypes.extension "*.jpg;";
    allTypes.push(imageTypes);

    var 
    fileRef:FileReferenceList = new FileReferenceList();
    fileRef.browse(allTypes); 

  4. #4
    Junior Member
    Join Date
    Apr 2008
    Posts
    14
    imageTypes.description = "Images (*.JPG";
    imageTypes.extension = "*.jpg;";

    worked perfectly thankyou very much and good day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center