A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: another flash 8 upload issue...

  1. #1
    Member
    Join Date
    May 2005
    Posts
    30

    another flash 8 upload issue...

    I have seen this problem adressed before, but its not exactly the same, so here we go..

    Just a simple (and maybe stupid) question...

    Problem: Tyring to upload files locally stored on a computer to a private system with no anonymous login..

    The swf and php that controls the upload is in the directory on the server where i want the files to be stored.

    This results in output: errorString: securitySandboxError

    System.security.allowDomain("*") or
    System.security.allowInsecureDomain("*")
    and https, specifying :443 does not the trick.


    I know the following:
    Quote: "If your server requires user authentication, only SWF files running in a browser--that is, using the browser plug-in or ActiveX control--can provide a dialog box to prompt the user for a user name and password for authentication, and only for downloads. For uploads that use the plug-in or ActiveX control, and for uploads and downloads that use the stand-alone or external player, the file transfer fails."

    What does this mean?
    The question is.. Is there no way, at all, to do this?
    I can do it with just php, no security issues there...
    Cant this be done in flash?
    Frustrating...


    Thanks.

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    you should simply use script based authentication rather than htaccess. This way the user has to fill a form, either in php or flash part, and can then use the upload.

    Musicman

  3. #3
    Member
    Join Date
    May 2005
    Posts
    30
    Quote Originally Posted by Musicman
    Hi,

    you should simply use script based authentication rather than htaccess. This way the user has to fill a form, either in php or flash part, and can then use the upload.

    Musicman
    Hi! And thanks for the post.

    I managed to find something though...

    The sandboxerror was misleading. It seems the only problem, maybe for many people out there would be the following (at least if they were using the macromedia example):

    /* Upload the file to the PHP script on the server. */
    selectedFile.upload("http://www.helpexamples.com/flash/file_io/uploadFile.php");

    Which should translate to:
    selectedFile.upload("http://www.yoursite.com/something/something/uploadFile.php");

    NOW: do NOT use this way of adressing the php-script. This is what triggers the sandbox error. Seems this is interpereted as an outside source...
    Use the local filename only:
    selectedFile.upload("uploadFile.php");

    Now it works perfectly....

    Maybe im an idiot, but i just used the syntax macromedia suggested in the example. And as i figured that, at least that should work, the error was kinda hard to locate..

    And a big thanks to Macromedia for making this harder than it is, with this example...

    Any comments is appreciated..

  4. #4
    Senior Member
    Join Date
    Aug 2001
    Location
    Philippines
    Posts
    515
    Excellent. What a simple fix!! Thanks!
    Ramon Miguel M. Tayag

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