Uploading files to the server using AMFPHP

Hey everybody. I am building an application that allows the user to upload jpg files. For this I use AMFPHP and attempts to send a ByteArray in the php service file. But I keep getting the following errors:

Gravity and Description path location creation time Id resource
1061: call to a load method possibly undefined via a reference with flash .net: FileReference of static type.     MultiGallery/src/MultiGallery.mxml line 86 1271268938265 99

Gravity and Description path location creation time Id resource
1119: access to data of property may not set via a reference with flash .net: FileReference of static type.     MultiGallery/src/MultiGallery.mxml 93 1271268938266 100 line

These are the lines of code generating errors:

private void loadFile(e:Event):void

          {

. file.addEventListener (Event.COMPLETE, uploadFileComplete);

file.addEventListener (ProgressEvent.PROGRESS, onUploadProgress);

file.load ();

          }

uploadFileComplete(e:Event):void private function

          {

var fileRef:FileReference = e.target as FileReference;

var fileName:String;     

byteData = fileRef.data;

fileName = fileRef.name;

          }

Any suggestions please?

Thanks in advance!

Hello

This code is flex 4 but you can still use the routines in flex 3, if this does not work with targeting of fp 9 10 try to see if it works, I don't remember what has really changed in fp filereference 9 FP 10. The code takes the filereference data it sends to the amfphp service that records the image on the server.

I also have another version that can resize the image before sending it, but need to test it a little.

http://ns.Adobe.com/MXML/2009.

xmlns:s = "library://ns.adobe.com/flex/spark".

xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" viewSourceURL = minHeight "srcview/index.html" > "

Import mx.controls.Alert;

Import mx.rpc.events.FaultEvent;

Import mx.rpc.events.ResultEvent;

private var fr:FileReference = new FileReference();

private void loadImage(): void

{

fr.addEventListener (Event.SELECT, selectedImage);

fr.addEventListener (Event.COMPLETE, getImage);

var imagesFilter:FileFilter = new FileFilter ("Images", "*.jpg, *.gif, *.png");

Fr. Browse ([imagesFilter]);

}

private void selectedImage(e:Event): void

{

fr.removeEventListener (Event.SELECT, selectedImage);

Fr. Load();

}

private void getImage(e:Event): void

{

fr.removeEventListener (Event.COMPLETE, getImage);

If (fr.data.length > 0)

{

Uploader.localimg (fr. Data, fr. (Name)

}

}

private void onFault(e:FaultEvent): void

{

Alert.Show (e.message.ToString (), "Error");

}

private void isImageUploaded(e:ResultEvent): void

{

Alert.Show (e.message.ToString (), "result");

}

]]>

PHP

===

class upload

{

function uploader()

{

Define the methodTable for this class in the constructor

$this-> methodTable = array)

"Upload an image"-online (table)

"description'-online"local to class server image. "

'access' => 'remote '.

)

);

}

function localimg ($ba, $fname) {}

$deffilepath = '... /... /images/full/'.$fname;

$data = $ba-> data;

$data = mysql_real_escape_string ($data);

file_put_contents ($deffilepath, $data);

return ("completed");

}

}

?>

Tags: Flex

Similar Questions

  • How to send a file to the server using the flash?.

    How can I send a photo for example to set up a virtual catalog and preview my album?
    I use a simple form with 5 fields of transmission and the small image after submission.

    If you want to download a file to your server using flash, use the Flash filereference class (and its upload() method) and backend scripts.

  • Upload files to the server

    Hello
    I want to download files (pdf, word, etc.) on the server, not a database.
    Is that when downloading a file is temporarily stored in a virtual table do not remember his name, I want to do is take the virtual table and upload to the server.
    and I just want to use a table to save a reference to this file.
    For example:
    a user downloads a file in / home / user / documents
    I downloaded the file and now the table is saved
    file name / rutaFichero (hyper text file)
    'the Uploaded document' / home / user / documents / document Uploaded

    I give you on the path / home / user / documents / document Uploaded
    and I download the file

    can we do?
    and as this would be the way?
    I'm newbies in the present, explain the easiest way possible

    Thank you

    Hello

    You must write the pl/sql code to do this.

    url suite can help you.

    http://www.DBA-Oracle.com/t_writing_blob_clob_os_file.htm

    or

    Search for 'write the blob in oracle file' in google.com

    Thank you
    Stefan Bosamiya,
    + 91 76000 23053
    http://jbosamiya.blogspot.com

  • what object to use to write uploaded files to the server?

    Hello

    My question is trivial, but I do not know how to solve. I need to download file *.xml server on my cell phone and write it on the mobile. There are input/output streams to read/write. OK, but what I should write the file I've already read? byte [] table? but I don't know what should be the size... cause, I guess I can't write data directly on my mobile? If Yes, can someone suggest me how?

    concerning

    Oh God, I'm so stupid! It's so http:

    _httpConnection.setRequestMethod ("post");

    _httpConnection.getResponseCode ();

    works great!

    concerning

  • How to send a file in the server of the University Complutense of MADRID using the Code?

    Hello

    I tried several times to upload a file to the server of the University Complutense of Madrid from the adf page, but I can't do it.

    First: I have used this method to do, but it feel that the file downloaded successfully and when I open the server I haven't found this...

    public String addNewContent() {}
    InputStream fileStream = null;

    try {}
    createConnection();
    String filePath = "C:\\Users\\Administrator\\Desktop\\ucm classes\\Class1.java";
    String autherName = "weblogic";
    fileStream = new FileInputStream (filePath);
    = New File (filePath);
    String [] fileTitle = filePath.split("/");
    long fileLength = new File (filePath) .length ();
    param.getBinder (.putLocal (CMConstants.CM_SERVICE_NAME),
    CMConstants.CM_CHECKIN);
    param.getBinder () .putLocal ("dDocType", "Application");
    Title of the downloaded file
    param.getBinder () .putLocal ("dDocTitle", fileTitle [fileTitle.length - 1]);
    Name of the author
    param.getBinder () .putLocal ("dDocAuthor", autherName);
    Content security for (Group and account)
    param.getBinder () .putLocal ("dSecurityGroup", "Public");
    param.getBinder () .putLocal ("dDocAccount", "");
    param.getBinder () .putLocal ("dFormat", "text/html");
    param.getBinder () .putLocal ("xCollectionID",
    (getFolderIdFromPath ("/ Contribution dossiers/22 /"))) ;
    param.getBinder () .addFile ("primaryFile", file);
    param.setServiceResponse (param.getIdcClient (.sendRequest (param.getIdcContext ()),
    (param.getBinder ()));

    InputStream myInputStream = param.getServiceResponse () .getResponseStream ();
    String myResponseString = param.getServiceResponse () .getResponseAsString ();
    System.out.println ("downloaded file Details: \n" +)
    myResponseString);

    DataBinder myResponseDataBinder =
    param.getServiceResponse () .getResponseAsBinder ();

    System.out.println ("file uploaded successfully");
    } catch {(IdcClientException idcce)
    System.out.println ("IDC customer Exception occurred. Cannot download the file. Message: «+»
    idcce.getMessage () + ", the stack trace:");
    idcce.printStackTrace ();
    } catch (IOException ioe) {}
    System.out.println ("IO Exception has occurred. Cannot download the file. Message: «+»
    ioe.getMessage () + ", the stack trace:");
    ioe.printStackTrace ();
    } catch (Exception e) {}
    System.out.println ("Exception occurred. Cannot download the file. Message: «+»
    e.getMessage () + ", the stack trace:");
    e.printStackTrace ();
    } {Finally
    If (param.getServiceResponse ()! = null) {}
    param.getServiceResponse (m:System.NET.Sockets.Socket.close ());
    }
    If (fileStream
    ! = null) {}try {}fileStream.close ();} catch (Exception e) {}e.printStackTrace ();}}}

    Returns a null value.

    }

    ----------------------------------------------------------------------

    Second: I used this method, but it did not work also

    public String uploadFile() {}
    try {}
    String inputFile1 ="";
    UF UploadedFile = (UploadedFile) inputFile1.getValue ();
    String filePath="C:\\Setup\\mmm.txt; »
    InputStream fileStream = null;
    try {fileStream = new FileInputStream (filePath) ;} catch (FileNotFoundException e) {}}
    String [] fileTitle = filePath.split("/");
    long fileLength = new File (filePath) .length ();

    //DataBinder Binder = IdcClient.crea
    param.getBinder (.putLocal (CMConstants.CM_SERVICE_NAME),
    CMConstants.CM_CHECKIN);
    param.getBinder () .putLocal ("dDocAuthor",
    "weblogic"); If the user is admin, can specify any user
    param.getBinder () .putLocal ("dDocTitle", "titleee");
    param.getBinder () .putLocal ("dDocName", "nameee");
    param.getBinder () .putLocal ("dDocType", "DigitalMedia");
    param.getBinder () .putLocal ("xCollectionID",
    getFolderIdFromPath ("/ files/11 Contribution")); parent folder
    param.getBinder () .putLocal ("dSecurityGroup", "Public");
    param.getBinder () .putLocal ("dDocAccount:", "");
    param.getBinder () .putLocal ("xComments", "Review of Montreal");
    param.getBinder () .putLocal ("xWCTags", "Montréal");

    param.getBinder () .addFile ("primaryFile",
    new TransferFile (fileStream, 'child',
    fileLength,
    "text/html"));
    ServiceResponse response =
    param.getIdcClient (.sendRequest (param.getIdcContext ()),
    param.getBinder ());

    } catch (Exception e) {}
    System.out.Print("");
    }

    Returns a null value.
    }

    -------------------------------

    Can someone tell me what's wrong? !

    Thank you

    This will definitely work

    package demo;
    
    import java.io.*;
    import oracle.stellent.ridc.*;
    import oracle.stellent.ridc.model.*;
    import oracle.stellent.ridc.protocol.*;
    import oracle.stellent.ridc.protocol.intradoc.*;
    import oracle.stellent.ridc.common.log.*;
    import oracle.stellent.ridc.model.serialize.*;
    import oracle.stellent.ridc.protocol.http.*;
    import java.util.List;
    
    /*
     * This is a class used to test the basic functionality
     * of submitting a checkin to Content Server using RIDC.
     */
    
    public class TestRIDCCheckin {
    
        public static void main(String[] args) {
            // Create a new IdcClientManager
            IdcClientManager manager = new IdcClientManager();
            try {
                // Create a new IdcClient Connection using idc protocol (i.e. socket connection to Content Server)
                IdcClient idcClient = manager.createClient("idc://localhost:4444");
                // Create new context using the 'sysadmin' user
                IdcContext userContext = new IdcContext("sysadmin");
                // Create an HdaBinderSerializer; this is not necessary, but it allows us to serialize the request and response data binders
                HdaBinderSerializer serializer = new HdaBinderSerializer("UTF-8", idcClient.getDataFactory());
    
                // Databinder for checkin request
                DataBinder dataBinder = idcClient.createBinder();
                dataBinder.putLocal("IdcService", "CHECKIN_UNIVERSAL");
                //dataBinder.putLocal("dDocName","TestRIDCCheckin");
                dataBinder.putLocal("dDocTitle", "Test RIDC Checkin");
                dataBinder.putLocal("dDocType", "Document");
                dataBinder.putLocal("dDocAccount", "");
                dataBinder.putLocal("dSecurityGroup", "Public");
                dataBinder.addFile("primaryFile", new File("c:/test.txt"));
    
                //dataBinder.putLocal("doFileCopy", "1");
    
                // Write the data binder for the request to stdout
                serializer.serializeBinder(System.out, dataBinder);
                // Send the request to Content Server
                ServiceResponse response = idcClient.sendRequest(userContext, dataBinder);
                // Get the data binder for the response from Content Server
                DataBinder responseData = response.getResponseAsBinder();
                // Write the response data binder to stdout
                serializer.serializeBinder(System.out, responseData);
    
            } catch (IdcClientException ice) {
                ice.printStackTrace();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            }
        }
    
    }
    
  • Problems using the file on the server

    Lately, we have difficulties to use the suite of creative cloud files. When the file is opened for some time, the software crashes. However, if the file is copied to disk local is not a problem.

    Contact support via chat, he guided me to use the file locally, because Adobe does not guarantee the functionality of the files on the server, only disk locally on the workstation.

    Anyone knows help me or have experienced this situation?

    It's just that: work locally.

    For some people indeed does the work on the server, but it's a very personal thing as there are a lot of different hardware and software solutions interfering (all the different servers and switches, and cables and their operating system). For some people, it can even run on a computer but not on the other in the same room.

  • Some files on the server may be missing or incorrect. Clear the cache of the browser, and then try again. If the problem persists, please contact Web site author.

    Hello I am trying to download my site www.novopro.co.uk screw "Publish to FTP" I have updated a page and downloaded from the website and now I get this warning on everypage. Some files on the server may be missing or incorrect. Clear the cache of the browser, and then try again. If the problem persists, please contact Web site author. If I click ok the site will load, but I get this error on everypage. I removed all widgets party 3 E, g, engines search, galleries etc.

    I looked through the forum, but not seen no real solution to the issue, I looked at the 'Muse.assets' in the JSConsole and the only script to update is touchswipe.js I do not understand why its doing so, my host said there is no problems with the servers smd ive only uploaded the site (all files) several times.

    My client is now a little inpatient as im yet to find a solution and I'd like to solve this problem as soon as possible. Please can someone help me shed light on the issue and im using the latest version of adobe Muse. Adobe Muse CC 2015.2.1

    Thanks in advance.

    In addition to what was suggested above, you can see if there are other solutions in this doc "some files on the server may be missing or incorrect" Warning Message that can help you and let us know?

  • Only in Chrome - «some files on the server may be missing or incorrect...» »

    I get the following error message on a site I'm building:

    "Some files on the server may be missing or incorrect. Empty the cache of the browser, and then try again. If the problem persists please contact author Web site. »

    This error only appears in Chrome. It does not appear in firefox or IE. Once I click 'ok' to clear the error the site load correctly.

    The site in question is www.auravana.com. The error appears on the home page as well as on other pages.

    I removed the document created by Sanjit_Da on the subject ("some files on the server may be missing or incorrect" Warning Message ), which was created in January of 2015. I was not able to determine the cause of the error by using the document. I also searched the forum for an answer, and although other people have had similar problems, none of their answers have helped me solve this problem.

    I do not use BusinessCatalyst. In Muse, export the Internet site 'in HTML format. I then all zip files and upload them to the server. Miss me not all the files and I'm not running in all conflicts. I have reviewed the homepage in the console of Chrome to see if there are errors, and there are no errors.

    I don't know what else to do. Any help is really appreciated.

    Yes that's right, the widgets must be updated by their developers as soon as the new update of Muse free.

    So please try to contact your widget developer and ask them to update widgets fo Internet Explorer.

    Best regards

    Ankush

  • Some files on the server may be missing

    I am running the latest version of Muse (2015.2).  When I go on my site, I get the above message.  I tried to re - download the entire site.  I've ONLY used TO HOST FTP UPLOAD to publish my site.  I deleted the browser cache and it continues to appear on my site (btca.com).  For any help or suggestion would be greatly appreciated.  Thanks in advance.

    Hi Karine,.

    Please try the solution mentioned in this post - some files on the server may be missing .

    Let me know if this helps.

    Thank you

    Ankush

  • Some files on the server is maybe missing or incorrect... after updating Adobe Muse

    I just recently updated to the 2015.2 Muse and now one of my sites (which was working fine before the update) now gives me the error message.

    Some files on the server may be missing or incorrect...

    "And the message: JavaScript exception: error by calling the selection function: TypeError: cannot read property 'msie' undefined '.

    This had not happened before and now I can't download or push all new living changes because of this error.

    Can someone shed light on this please? I desperately need to get a new live version with updates but cannot until this is rectified.

    Karen

    Hi Karen,.

    Thank you for reaching out to us on this subject.

    The problem occurs because some third-party widgets used in the site that load a lighter version of jQuery, which does not include a browser (jquery.browser) detection method, which is needed for the sites of Muse:

    Then to get rid of this problem, you must remove any third-party widget first and then upload your site.

    If you wish to continue using the third party widget, we recommend you reach out to the third party and inform them that, "if they want to load another version of jQuery that Muse loads by default they should load the entire library".

    Yet, we recorded this bug, and you can expect a fix in the next update.

    Best regards

    Ankush

  • I receive a notice indicating that there are errors with some of the files on the server during the launch of the site

    I publish the site in HTML and then upload using FTP software.

    The reason is that I change the lines < body > to automatically resize the onLoad of the page.

    I just start getting a pop-up window when the site launches who says:

    Some files on the server may be missing or incorrect. Clear the cache of the browser, and then try again. If the problem persists, please contact Web site author.

    Any idea what's going on?

    Thank you

    Have you read the cited document as Vivek? "Some files on the server may be missing or incorrect" Warning Message>

    Home.css on your server file is a different version of your site as the home.html file. They must be synchronized for the page to be guaranteed to work properly.

  • The files on the server may be missing or incorrect problem

    Hello

    The files on the server may be missing or incorrect

    I know this has been covered before, but it's different.

    I get this message when previewing my site today, I was fighting trying to problem solve this problem for hours.

    It seems even new and empty pages do that when either viewable in web or Muse.

    I've updated creative cloud, not help.

    Anyone else having this problem?

    My next step is a complete reinstallation.

    Thanks for any kind of help.

    SEB

    In the four years and several million downloads of Muse from Muse Public Beta 1, I don't remember anyone ever have reported this error at the premiere in the Muse. The error is designed to detect an incomplete download on a server hosting, which is fairly common, if a user of Muse exports files of a site to a folder, and then manually download these files using a third-party program FTP, instead of using publish it integrated or Upload FTP host has. However, it is not at all what you're a statement.

    Any time a page is produced by Muse the .html file and the .css file are generated. They have a game. For a local preview to report the two incompatible files implies something on your computer is interfering with the ability of Muse to write these files in "%appdata%\com.adobe.AdobeMuseCC.2015.0\Local Store\Preview" and doing so in a way only can/does not detect Muse.

    What anti-virus/anti-malware software do you use, if any? It is potentially configured such that it interferes with the Muse write files to this location?

    What version of Muse you use (as stated in the Adobe Muse CC dialog box)?

  • Muse CC 2015 update error: «some files on the server may be missing or incorrect...» »

    After an update to the Muse CC 2015, I get this error: "some files on the server may be missing or incorrect. Clear the cache of the browser, and then try again. "If the problem persists please contact the author of the Web site." I went as far as the incorporation of images and still get this error. I have not edited my CSS or Scripts. I have added Google Analytics to index.html

    The site worked fine before the update. I have no errors or missing files in my links or layers.

    I use Mac OS 10.10.3 with Chrome, Safari and Firefox. I watched it via a laptop, iPhone and the desktop, I get the error on all 3 browsers via the bureau on Safari via iPhone, etc.

    I can't find anything current about this problem in Muse CC 2015. Help, please. Thank you!

    Please see "some files on the server may be missing or incorrect" Warning Message>.

    If this does not help solve you the problem, please post the URL of your site and let us know how the site is transferred (i.e. with the help of publish, using the file > Upload FTP host, or by using the file > export to HTML and other FTP client software)?

  • I always get this message: some files on the server may be missing or incorrect. Clear the cache of the browser, and then try again. If the problem persists, please contact Web site author.

    It seems to happen whenever a update of Muse coming...

    I'll transfer my site and when I visit it I get this message even that was supposed to be resolved there are a few versions:

    "Some files on the server may be missing or incorrect. Clear the cache of the browser, and then try again. If the problem persists please contact author Web site. »

    I use the latest version of Muse: 2014.3 release

    I looked at my list of assets within the Muse - nothing is marked not linked.

    I tried to upload my site many times... within the Muse and with FileZilla.

    Fortunately, I have saved the latest version of my site - which was created in the version prior to 2014.3 - and downloaded again.  It works and can be seen here: www.snapscene.ca.

    But as soon as I make all the changes file of Muse, save it under a different name (to be compatible with 2014.3) and upload it - I get the message when visiting the site.

    What gives?

    -Adrian

    It seemed to me the solution.

    When I export the files, I simply left Muse overwrite the files in the destination folder. The files may not overeritten correctly.

    Manually, I went into this folder destination and destroyed all the old files exported.

    I then re-exported the files and then uploaded. All workes from there.

  • Slide show "some files on the server may be missing or incorrect.

    This is my first try with Muse, and I'm just trying created a slideshow of pictures from make-a-wish my son trip. It looks fine in preview in the Muse, and if I open it with Firefox or Safari to the index.html file on my hard drive, it seems there, also. But when I download the page to my URL, it only displays the text suddenly and gives me this error: «some files on the server may be missing or incorrect...» "And if I try to view a single image, it tells me access to the image is forbidden, even though I know the image is there, and I did not put any restriction on privacy.


    Here's the web address: home

    Help!

    All tool allowing you to download files and folders malfunctioning the permissions on the folders. You can change the permissions on the folders, or remove the downloaded files/folders and then re - download either using the file > publish FTP host... feature of Muse (and the first time select Upload: All Files) or re-upload using a different external FTP (Filezilla for example) program, which manages the folder permissions correctly.

Maybe you are looking for

  • Film vs my photo stream

    I tried to move photos from my iPhone to my iMac.  I connected my iPhone to my iMac.  613 photos to import.  Photos of 613 were in my camera.  I have 974 photos in my iPhone photo stream.  What is the difference between the film and my photo stream. 

  • Why firefox is always problem when I put cache 0 MB Web site?

    Hello I develop Web sites and about 1 month, I think that to the top of the Version 30 or 31 have problems with the cache. I activated the manual cache size and set it to 0MB (Web sites), but I still have problems that a site is cached. In developmen

  • How can I transfer photo from Nokia N97 Mini to Backflip by Blue Tooth?

    Hi all, I'm sorry because I'm a new user since 05/10/2010 wef. Just bought the phone of the telco company. Blue tooth file transfer impossible. Could someone tell me Y?

  • play music instead of silence on the default script

    I'm trying to configure the IPCC Express If Agents are busy or not ready, default script from the IPCC plays the welcome message then the time of silence then greeting and so on... I want to replace the time of silence by music file How can I do this

  • Schedule of blackBerry Smartphones: vs email calendar default device

    I'm new to the Blackberry Pearl 8130. I use Microsoft Outlook for my calendar. I have an email address to which I've implemented on the Blackberry. However, this email address doesn't have a calendar that are associated with (and I don't want it...).