File Load is not working on Mac but Windows

Hi i'm developing an app which simply load files (images and sounds) and uses binary data. Application is working fine on Windows, but it raises error on Mac.
Now i dont own Mac so i cant debug it, I also googled but couldnt find anything close to it.
Please advise
Thanks
PS: Its an AIR APP
Here are snippets to understand the code
//browse file
_loadFile.addEventListener(Event.SELECT, selectHandler);
_loadFile.browseForOpen(title, typeFilter);
//selectHandler
_loadFile.addEventListener(Event.COMPLETE, loadCompleteHandler);
_loadFile.load();
//loadCompleteHandler
//works on windows but TypeError on Mac
switch(file.type.toLowerCase()){
  case ".mp3":
  var sound:Sound = new Sound();
  sound.loadCompressedDataFromByteArray(file.data, file.data.length);
  fileHandler(sound);
  break;
  case ".jpg":
  case ".png":
  case ".jpeg":
  case ".gif":
   loader = new Loader();
  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadBytesHandler);
  loader.loadBytes(file.data);
  break;
//loadBytesHandler
fileHandler(loader.content);

I just tried a simple File load test and the type property always traces out null. According to the ASDocs, the type property: "On the Macintosh, this property is the four-character file type, which is only used in Mac OS versions prior to Mac OS X. If the FileReference object was not populated, a call to get the value of this property returns null.".
Further reading into the FileReference docs, all properties are supposed to be populated once the complete event fires and that is when I ran a trace of the File.type.
Since the is an AIR app, you might want to consider using the extension property instead to know the file extension to run a switch case against. The ASDocs also say that in reference to Mac's: "You should consider the creator and type properties to be considered deprecated. They apply to older versions of Mac OS.".
If you choose to use the extension property instead, you don't have to include the "." in your switch statement. The ASDocs do say that "If there is no dot in the filename, the extension is null." So, you may want to run some tests on Windows to make sure that "extension" works. On Mac OS, pretty much every user friendly file (image, movie, document, etc) has a file extension so you shouldn't have any concern of extension returning null on Mac OS.
You probably got the TypeError on Mac OS because you were trying to run a String method on a null object at the start of the switch statement.
FileReference.extension

Similar Messages

  • SQl loader is not working in 10g but working in 9i

    In My PC i have installed both 9i and 10g. could you please tell me why it is not working

    "SQL loader is not working" is rather like "my car won't start" http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    The 9i Oracle Client install includes sqlldr. The 10g Oracle Client install does NOT include sqlldr. You'd have to do a "Custom" Install and specifically select "Oracle Database Utilities" to install.
    See MetaLink Note#437377.1
    Edited by: Hemant K Chitale on Dec 31, 2008 3:58 PM
    Edited by: Hemant K Chitale on Dec 31, 2008 4:00 PM

  • Uploading files to website not working with Safari in Windows 7

    Safari version: 5.1.7
    OS: Windows 7
    Hi,
    I am a website owner, and I have a feature on my site where users can upload large (up to 50MB) music files to my server. The feature works in Firefox on OSX & Windows platforms and it also works in Safari on OSX. The uploading feature is not working with Safari for Windows. Do you have any idea why and how to fix this? It can't be an issue with my server as it works in other browsers fine and works fine in Safari for OS X.
    If you have any information on how to solve this or things for me to try to rectify this for use with Windows operating system it would be much appreciated.
    Thanks.

    GREAT NEWS!!!!
    I have solved this issue myself with some help from my a user on Microsoft Forums. The issue stems from the mime type of each Browser Chrome, IE, & Safari for Windows defaults as audio/wav. When the mime type is changed to audio/x-wav everything works. Firefox defaults to audio/x-wav and when changed to audio/wav it DOES NOT work.
    Once I input some code in my .php upload page to change the mimetype if audio/wav is detected everything works GREAT!!!
    So Here is what you need to do: Find your upload page and input this code:
    echo "<p>MIME Type: ".$_FILES["file"]["type"]."</p>";   
    right before your "If/then" statement of file type. For me it was near line 30 in my upload.php page, but I'm sure this is different for everyone.
    This will detect and DISPLAY the default mime type of your browser on the error page when your upload doesn't work. Once you know what mime type works for your file type then you can change your "if/then" statement for mime type upload to change your mime type to the correct one.
    I don't want to give the code here, because I'm sure it's specific to your file types and your site construction, but this should lead you on the right track.
    ***This is the solution if you ARE NOT ABLE to upload any certain file in a certain Browser. It has to do with mime type construction***
    I hope this helps others like it helped me!!!!!

  • Boot Camp 3.0, Size 900Mb having Drivers in it, not working On MAC with Windows 7

    Hello.
    I have installed Windows 7 on my MacBook Pro MD103LL/A without installing its drivers , used Boot Camp to install windows but unchecked the "Download Suport Drivers" for windows 7 and only installed windows 7.
    Then on logging into Windows 7 i have installed BootCamp version 3.0 for windows 7 successfully but none of my drivers got updated through it as it showed the updating process while installing on windows but didnt update my windows 7, then i installed Boot Camp 3.1, 3.2 , 3.3 as Update on windows still nothing happened Whats the issue ?? I am not installing the drivers through BootCamp of MAC because it takes ages to download them thats y i found this as solution to install boot camp drivers on windows manually but the solution is not working for me PLZ HELP I shall be hight Thankfull.

    Thanks mende1 . 
    I am receiving this erro on the above link
    The requested URL /content/downloads/54/00/041-0694/sq2RLp7XVNQzRG8qdpsq9sj4pHsgXkgPYg/BootCampES D.pkg was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache Server at swcdn Port 80

  • Wifi not working on mac air windows 7

    i cant get connected to internet after installing window 7 on my new macbook air no wi-fi bars in the tray,any help will do

    Have you installed the Windows support software?
    If not, restart your Mac, hold the Option (Alt) key while your Mac is starting and choose your OS X volume.
    After starting up, open Boot Camp Assistant (in /Applications/Utilities), press Continue, and tick only the option to download the Windows support software. Then, follow its steps to burn it into a USB drive.
    When it has finished, restart in Windows, access to your USB drive from Windows Explorer and run the installer. Your drivers will be installed, and after a simple restart, you will have Wi-Fi

  • .mov Files not working in Mac but working on Windows

    I use a Kodak 10MP digital camera to click. I use it to shoot some videos too.
    I had some videos taken earlier on the camera and used to view them on windows. Just bought a Macbook a few days ago, and all those videos worked fine (transfered using an external drive). But there is something I m so confused with now.
    All the videos I shoot now, iPhoto does not import (hangs). I copied the video to windows where I could see all easily, and copied it to a pen drive. But sadly even trying to open them on pen drive doesn't work. It says its not a .mov file (dimension: -- --) whereas earlier videos be it 640x480 or HD worked fine. Do note videos are working on Windows. I have Quicktime 10.0 and player 7 installed.
    Please help.

    Won't you mid it AMAZING
    Windows Quicktime and VLC are playing the files easily. Mac OS X is not. aren't mov files exclusive to Apple?
    There are no picture settings on the camera (heck the camera is so bad you can't do anything even on trying). How is this possible that old videos worked and new aren't. I can't even sleep until I understand.
    Already feeling going the Mac way wasn't the right choice. Should have stuck with Windows.

  • 2-seat license not working on Mac running Windows 7

    We have a full retail copy of Adobe Acrobat Pro XI.  We are trying to get it installed on an Intel-Mac (2009 Macbook Pro) running Windows 7 on Bootcamp.
    After a fresh install, we successfully license the software with the license key.  All works well after that until we boot the Mac up in Mac OS X.
    In Mac OS X, we launch Parallels, a third-party tool that allows you to run Windows-installed applications natively on the Windows Partition, to launch the same installed copy of Acrobat.  Note, that we do not have Parallels configured in such a way as to run applications in a virtual machine manner.
    When we launch Acrobat Pro here, we get the dialog that says it's a Trial copy.  Thinking, 'well, ok, maybe we need to use up another seat of our license', we enter the same serial number again.  Acrobat Pro XI works from then on activated on the Mac side.
    BUT, when we boot backup into Bootcamp to verify that the 1st seat is still ok, we get the Trial dialog there.  Back and forth, infinitum, we are unable to get a licensed version of Acrobat to run in both places.  What are we doing wrong?

    Thank you, but we're not trying to install or run the Mac version of the Adobe product. 
    On Intel Macs you have a choice of running the Windows product either under Bootcamp or under Parallels.  Both environments are native Windows.  In fact, they are identical.  You just access them from two different boot environments on the same machine.
    We've tried two different serial numbers, and we've tried both seats of the same serial number.  Either way, no luck.
    I had an Adobe support person tell me recently they have had problems with Parallels and so no longer support it.  Too bad.  We haven't had any issues with non-Adobe software working under either of these two Windows environments.
    Carl

  • ESC (Escape) key not working in Mac and Windows?

    It just won't work. Both OSes.

    A bloating battery is a bad battery dying and developing gas inside. If this happens the bloated part can be under the left upperside of the keyboard and put pressure there. It may bulge the underside of the macbook, it may bulge under the trackpad and cause irratical trackpad behaviour, etecera. Check the battery.
    If it is bad you should replace the battery.
    Keyboard: you can replace the keys (per key) I think, if it is a bad keycontact.

  • Link works on mac but not on pc

    Hi -
    I am trying to insert a jpg into a dreamweaver file.
    I then upload the html file along with the jpg to my server in a folder called "layout"
    So the url is:  http://www.mysite.com/layout/test.html
    The link works on mac, but not on pc's.
    Any idea why?
    Some links work on pc's like this, and others don't.
    Thanks- It's driving me crazy!!

    The link is not correct....you have it listed as" mysite.com", which I assume is where you are to insert the name of your url.
    Gary

  • Infopath form load rule not working in browser forms but works on Client

    Hi
    I am working on an Infopath form and there are rules on form load. The form load checks for a value in a list, if the username() matches the one in the list, then the form would change its view.
    It works when I open it on client, but on the browser it fails.
    Have anyone encountered such an issue.

    Check below:
    http://stackoverflow.com/questions/16222681/infopath-rule-is-not-running-when-checking-sharepoint-list-field-value
    Ensure that "Include data for the active form only" was checked (I had to separate this field into another data connection because that box could not be checked for another field I was using), and
    Ensure that in the rule I was selecting from the "dataFields" folder under the data connection instead of "queryFields"
    http://sharepoint.stackexchange.com/questions/28554/infopath-form-load-rules-not-working
    if I edit the Infopath form on Infopath 2007, it seems that the rules for the load form will be visible if created.
    This look like a bug. Here are the steps below that will lead you to the bug:
    Step 1: Open the infopath form in Infopath 2010 and create 6 rules for Form Load and Save it as a file.
    Step 2: Open that infopath form that you created in Step 1 in InfoPath 2010 and go to the
    Form Load section. You will only see the first 5 rules. The 6th rules that you created for Step 1 will just "vanish". Now, close that infopath form.
    Step 3: Open that infopath form that you created in step 1 in InfoPath 2007 and select Tools > Form Option. In the
    Open and Save category, click the Rules button and add a new rule in it and save it.
    Step 4: Open that infopath form that you modify as describe in Step 3 in InfoPath 2010. That 6th rule will be visible.
    Therefore, there might be a bug in InfoPath 2010 that restrict Rules to a max of 5 in Form Load and thus if anyone open that form in SharePoint, only the first 5 rules will be executed.
    If this helped you resolve your issue, please mark it Answered

  • New File() is not working on MAC

    Hi,
    I don't know exactly what is the problem,since i search in forums.
    but in my code
    File f = new File("/Users/sky/Desktop/dist/test.txt");
    is not working on Mac os.
    Please help !

    skymania wrote:
    On window it will give output : success
    On Mac it will give nothing.
    On window and mac both file is not exist (physically). Bull.
    Simply doing new File(...) does NOT create a file on disk, no matter what the OS.
    On Windows, before running the Java code:
    C:\>dir C:\CONFIG.SYS
    02/05/2008  01:06 PM                 0 CONFIG.SYS
    C:\>dir C:\zzzzz
    File Not FoundThen I run this Java:
    package scratch;
    import java.io.File;
    * Copyright (c) 2009 Tone Software Corporation
    * @author Jeff Verdegan
    public class NewFileDoesNotCreateAFileOnDisk {
      public static void main (String[] args) throws Exception{
        File f1 = new File("C:/CONFIG.SYS");
        File f2 = new File("C:/zzzzz");
        System.out.println(f1.getCanonicalPath () + ".exists() is " + f1.exists ());
        System.out.println(f2.getCanonicalPath () + ".exists() is " + f2.exists ());
    }and I get this result:
    C:\CONFIG.SYS.exists() is true
    C:\zzzzz.exists() is falseAnd then I do the dir again, and I get the same results.
    Thus proving that new File does NOT create a file on the disk.
    If you would bother to read the docs for the File class like I suggested, you'll see a way that you can create a file on disk.
    And if you read my other comments, you'll see how to create a file as you write to it.

  • Tried to download version 4, which replaced old 3.6, but I'm getting a message that version 4 will not work with Mac OS 10 (I have OS 10.4.11). How can I download previous Firefox version?

    Tried to download version 4, which replaced old 3.6, but I'm getting a message that version 4 will not work with Mac OS 10 (I have OS 10.4.11). How can I download previous Firefox version?

    You can download firefox 3.6.16 here: http://www.mozilla.com/en-US/firefox/all-older.html

  • I have a licensed copy of Adobe Acrobat X Pro for Windows.  I recently switched over to MAC OS and would like to move my Adobe X Pro over but the CD will not work for Mac OS?  Can anyone assist me with this conversion?  Best,  James.

    I have a licensed copy of Adobe Acrobat X Pro for Windows.  I recently switched over to MAC OS and would like to move my Adobe X Pro over but the CD will not work for Mac OS?  Can anyone assist me with this conversion?
    Best,
    James.

    you cannot use your pc license to install on a mac.  you would need a separate license (and serial number) for that.
    adobe allows platform swaps, but only with the latest (xi) version, Order product | Platform, language swap
    your option to use acrobat on a mac are to upgrade to acrobat pro xi and change platforms, use a windows emulator (parallels/boot camp etc) on your mac or swap with a third party.

  • The attach a file button (in netzero e-mail) does not work in firefox but does in explorer

    The "attach file button" (in net zero e-mail) does not work in firefox but does in explorer.
    == URL of affected sites ==
    http://

    *Tools > Options > Privacy > History: Firefox will: "Use custom settings for history"
    *Tools > Options > Privacy > History: "Remember search and form history"
    See also [[Form autocomplete]]

  • [svn:bz-trunk] 16869: Minor change to the build file to get it working on Mac.

    Revision: 16869
    Revision: 16869
    Author:   [email protected]
    Date:     2010-07-12 02:01:25 -0700 (Mon, 12 Jul 2010)
    Log Message:
    Minor change to the build file to get it working on Mac.
    Modified Paths:
        blazeds/trunk/apps/team/build.xml

    The new user helped a little but not enough to make the customer happy. I have done a bunch of research over the weekend and I have found there is a little known bug in Apple's ACLs. ACL stands for Access Control List and I have a snippet from a MacFixit that describes the issue:
    "A disappointing aspect of Repair Permissions in Leopard is that it does not deal with ACLs (Access Control Lists), a secondary layer of permissions control laid on top of standard Unix permissions, tentatively introduced in Tiger and actually used for the first time in Leopard. Repair Permissions will announce that it is surprised to discover that a certain folder has an unexpected ACL setting, but it won't do anything about it (in other words, it won't repair that kind of permissions)."
    Anyway it appears to me that if your privileges get hosed in a computer upgrade the only way to really fix the problem is copy all of your data to a second HD and then break out the install DVDs that came with the Mac Pro and do a fresh install and set the user/file-sharing up manually and then copy your data back to the Mac Pro. I did not connect back to the G4 to get the data again, I just copied my many years of correspondence back to the Mac Pro and this time everything works?
    The new user idea did let me manually drop files onto the Mac Pro from connected computers it WOULD NOT let me save files to the Mac Pro from network computers. I usually got a bad path message when I would try and save from Word or TextEdit. I figured I had wasted enough time on this problem and erasing everything and starting over was a better idea.
    Thanks everybody.

Maybe you are looking for

  • Hi frnds regarding ME01

    Hi frnds,               Very Urgent....               Is there any BAPI for ME01 for Uploading data. Points will be rewarded.... Thanks & Regards, Sirirsha.

  • I need a code example for an action listener for a jcheckbox using matisse

    I am trying to make it so that when some body clicks a jcheckbox it will put a figure into a jtextfield. Because I am using matisse I need to know the code for the action listener and I need to know quickly as well so I don't have time to look it up

  • Problem in updating files in BPM

    Hi , I have a question where I need to append two files and send them as one file at the receiver by using a coorelation. Lets Say we have two files -File A and File B both in delete mode .Both  are required to be appended and sent as one file ,say A

  • Connecting to HP Officejet 6500A Plus

    I'm having trouble connecting my macbook air to my hp office jet 6500a plus printer.  Both the mac and printer are on the same wireless router, but the mac still can't find the printer.  Any help would be greatly appreciated. Thanks.

  • How to adjust gap between tilelist items?

    Hi, I have a tilelist which uses a custom item renderer component to render its items. I am seeing a gap between the rows of items (no gap between columns). I cannot seem to find a property of tileList which lets you adjust this gap. Can anyone help?