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:

<?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');


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
BHWW
View Replies:

concrete5 Environment Information

# concrete5 Version
5.6.3.3

# concrete5 Packages
Bear Adventures Charity Initiative (1.0.8), Page Auto Redirect (2.0), Page Redirect (1.4), Page Selector Attribute (1.1), Pro Blog (12.4.4), Zopim Chat (3rd party) (1.1.0).

# concrete5 Overrides
blocks/next_previous, blocks/autonav, blocks/search, blocks/content, blocks/page_list, blocks/problog_list, blocks/form, blocks/slideshow, blocks/image, languages/ro_RO, languages/zh_TW, languages/tr_TR, languages/fr_FR, languages/pt_PT, languages/ja_JP, languages/el_GR, languages/it_IT, languages/es_ES, languages/cs_CZ, languages/de_DE, languages/sk_SK, languages/es_AR, languages/ru_RU, languages/da_DK, languages/fa_IR, languages/ar, languages/sl_SI, languages/vi_VN, languages/es_PE, languages/es_MX, languages/nl_NL, languages/nb_NO, languages/fi_FI, languages/sv_SE, themes/gcs_theme_v2, themes/gcs_theme_v3, themes/gcs_theme

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Only when manually removed or the cache is cleared.

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.4.40

# PHP Extensions
apache2handler, apc, bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, ionCube Loader, json, libxml, mbstring, mcrypt, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, pspell, Reflection, session, SimpleXML, soap, sockets, SourceGuardian, SPL, sqlite3, standard, tidy, timezonedb, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 30
apc.max_file_size - 5M
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 90
max_input_vars - 1000
memory_limit - 128M
post_max_size - 32M
sql.safe_mode - Off
upload_max_filesize - 32M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 10000000
pcre.recursion_limit - 10000000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.