DISQUS

CarefulWeb: Careful Web: Upload to server with Adobe AIR and JavaScript

  • Josh · 2 months ago
    Thank you so much for this entry, this was Amazing! I had been struggling with this all day and I came across your blog and it worked perfectly the first time.
  • sami_c · 1 month ago
    what sould I do if I want the user choose the file to upload ?
  • dobrych · 1 month ago
    You need to add event listener for some button or link, which will run file dialog initialization.

    Here a sample init dialog code:


    <pre>
    var file = new air.File();
    var filter = new runtime.Array(new air.FileFilter("All files", "*.*"));
    file.addEventListener(air.Event.SELECT, callback);
    // where callback will be run on file selection

    // then show dialog
    try {
    file.browseForOpen("Open file", filter);
    } catch(e) {}
    </pre>
  • Josh · 1 month ago
    I got this working great on my mac, awesome help, but for some reason it will not accept dragged files from my windows machine, any thoughts would be awesome.

    Thanks
  • dobrych · 1 month ago
    Sorry, Josh, my main dev machine is Mac too, so I didn't have too much experience with debugging on windows. But my app (with upload code) have been run fine on WinXP on VmWare!