1. #1
    Ext User
    Join Date
    Oct 2008
    Vote Rating
    nokia786 is on a distinguished road


    Default echo back uploaded file into a textarea

    echo back uploaded file into a textarea

    I am trying to provide a file upload form to the user with the standard inputType as 'file'.

    The goal is to let the user see the uploaded contents back in a TextArea so that he can further edit the content.

    I have written a PHP that does the below:

        if (is_uploaded_file($_FILES['tpFile']['tmp_name']))
            $fileData = file_get_contents($_FILES['tpFile']['tmp_name']);
        echo '{success:true, file:\''. $fileData . '\'}';;
    The client side submits and receives like the below:

                            url: '/echoupload.php',
                            waitMsg: 'Uploading your data file...',
                            success: function(fp, o){
                            },failure: function(fp, o){
    There are two problems:

    1. This is not working in FireFox (FireBug shows an empty string for o.result.file.

    2. It is working in IE but the new lines are stripped off and all content is displayed in one line.

    Is there a standard approach to do this that I am over-engineering? The uploaded file can have data including special characters, new lines etc.

  2. #2
    Sencha User robertlight's Avatar
    Join Date
    Nov 2009
    Boston area
    Vote Rating
    robertlight is on a distinguished road


    Default Did you ever solve this?

    Did you ever solve this?

    I am trying to do the very same thing... did you ever solve this problem?

    Many thanks if you could post the solution!!

    - Bob

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi