Image Upload
Permalink Browser Info Environment
HI I've been trying to use your testimonials block as a base for a project i'm creating.
I've got it mostly working, however when users submit a testimonial they couldn't upload a file to go with it, I created some code to add this functionality but I still can't get it to upload the file. It maybe a timeout issue, or something, but are you okay enough with the code to be able to add this in? It probably requires an upload progress bar either jquery or ajax, but I just can't get it working.
Code I have so far is:
Ideally, and secondary I also need to change the date format to EU dd/mm/yy rather than use mm/dd/yy.
Happy to purchase a support ticket if you can do this.
Thanks
Ben
I've got it mostly working, however when users submit a testimonial they couldn't upload a file to go with it, I created some code to add this functionality but I still can't get it to upload the file. It maybe a timeout issue, or something, but are you okay enough with the code to be able to add this in? It probably requires an upload progress bar either jquery or ajax, but I just can't get it working.
Code I have so far is:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $form = Loader::helper('form'); $dth = Loader::helper('form/date_time'); $bears = unserialize(Config::get('ADVENTURES_BEARS')); $charities = unserialize(Config::get('ADVENTURES_CHARITIES')); if($_POST){ $block = Block::getByID($_POST['bID']); $cnt = $block->getController(); $postdata = $_POST; $filename = $_FILES['image']['name']; $file = $_FILES['image']['tmp_name']; Loader::library("file/importer"); $fi = new FileImporter(); $newImage = $fi->import($file, $filename); Loader::model('file_set');
Viewing 15 lines of 143 lines. View entire code block.
Ideally, and secondary I also need to change the date format to EU dd/mm/yy rather than use mm/dd/yy.
Happy to purchase a support ticket if you can do this.
Thanks
Ben
Type: | Ticket |
---|---|
Status: | New |