Multiple Image upload problem on hook on_after_post

edited July 2012 in News & Announcements
I am using fuel version 1 from github.
I have following problems:
1. the file upload path is not uploading on given path:

$upload_image_path = assets_server_path($CI->fuel->settings->get(MY_MODULE, 'asset_upload_path'));
$fields['photographs'] = array('label' => 'Photographs', 'class' => 'multifile', 'type' => 'file', 'upload_path' => $upload_image_path);
here the image is uploaded to assets_server_path() not my custom path. The path is correct I have checked.

2. after uploading data I want to manipulate the uploaded data. for this I am using on_after_post hook.
here I have codes as so:
function on_after_post($values){
$CI =& get_instance();

$data = $CI->upload->data();
var_dump($data);exit;
}
on the above code only one image data is displayed and shows the following errors:

Severity: Notice

Message: Undefined variable: field_name

Filename: controllers/module.php

Line Number: 1858
The error repeat = uploaded images number.

Comments

  • edited 12:37PM
    Is that folder writable by PHP?
  • edited 12:37PM
    I think I found the issue and posted a fix.
  • edited 12:37PM
    Thanks.
    got the fix. Still some issues.
    $CI->upload->data() 
    gives data for one image only while I am uploading multiple images.
  • edited 12:37PM
    I found the user_guide for v 1 and solved it with this:
    $this->fuel->assets->uploaded_data()
Sign In or Register to comment.