fileupload AJAX upload (Opps. Still on dinosaur technology?)- got it to work!

TheGr8

New Member
I noticed quite a few people were reporting this, so I decided to post here to show how I fixed it.

I updated from GitHub, as was suggested but that didn't fix the issue for me, so I started looking into console messages and noticed errors. Long story short - I had to rename a few files in the "/plugins/fabrik_element/fileupload/lib/plupload/js" directory:

plupload.html5.min.js > plupload.html5-min.js
plupload.html4.min.js > plupload.html4-min.js
plupload.min.js > plupload-min.js

that fixed the issue for me.

Good luck!
 
Thanks for taking the time on this one. I suspect Rob and I haven't hit this, because we pretty much always run in debug mode, so we don't use the 'minified' versions of the JS.

I suspect that rather than rename the files, we need to tweak the code that includes them. That way we can still use the standard plupload repo files.

-- hugh
 
Turns out altering the way we look for minified files is a little more complex than one might have thought, so for now I've just renamed those three files in the repo, just to get the basic "out of box" settings working.

I'll leave it up to Rob to decide how to approach that one in the longer term.

-- hugh
 
Hallo!

Yes, if I change the file-names the Ajax-Fileupload-Form-filed appears.
But the data from the upload are not saved in the database.
Please help!

Thank you!
 
I am now having the same problem as kissinger - the files are definitely uploaded to the server but I am having a hard time capturing the file names. A few months ago I was doing the same thing with J2.5 / F3.0. I wrote a little PHP form plug-in which basically grabbed the uploaded file and saved its MIME content in a database field. Today it doesn't work for me. It looks like because uploaded files are now kept in an array, even if I have maximum files set to 1. I don't remember whether I was using the AJAX upload with J2.5 / F3.0, so that might be what caused the array. Here's my plug-in that I used, is it easy to tweak it to work with F3.1 if I just need 1 file uploaded (I'd like to keep the AJAX upload if possible for cropping):

PHP:
<?php
 
//assumes 'jobs___image64' is uploadfile element
//assumes 'jobs___image' is a textarea element for MIME data

function processImage(&$formModel)
{
    $data =& $formModel->_formData;
    $source = 'jobs___image64';
    $filename = $data[$source];
 
    $filename = $_SERVER['DOCUMENT_ROOT'] . $filename;
 
    if ($filename)
    {
          $imgbinary = fread(fopen($filename, "r"), filesize($filename));
          $formModel->updateFormData('jobs___image',base64_encode($imgbinary), true);
          error_log("in: " . base64_encode($imgbinary));
    }
}
 
processImage(&$formModel);
 
?>
 
For me file is uploaded, however there are no signs of link in db.
My solution (temporary) - need 2 additional fields:
1) create upload ajax filed (html5)
2) create folder element with show file
3) create calc - ajax insert link

Open form. Upload file with upload element. Refresh (F5). Select file from folder element. Calc should calculate new link.

I really like Youtube tutorials ;-)
 
Just updated from SVN yesterday and tried it again and it still appeared to be broken. I switched to html4 and it got me a bit further but still no luck extracting the file name with a plug-in.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top