+1

I have the same issue on Ubuntu 12.04 LTS

*Warning* (2): chmod(): No such file or directory
[*APP/Plugin/Upload/Model/Behavior/UploadBehavior.php*, line *54*]

I have the fields in my database.

Here is the output from Code and Context debug links:












$model = object(VenueLocation) {

        displayField => 'name'

        hasMany => array(

                'Venue' => array(

                        [maximum depth reached]

                )

        )

        actsAs => array(

                'Upload.Upload' => array(

                        [maximum depth reached]

                )

        )

        useDbConfig => 'default'

        useTable => 'venue_locations'

        id => '9'

        data => array(

                'VenueLocation' => array(

                        [maximum depth reached]

                )

        )

        schemaName => 'd8book_new'

        table => 'venue_locations'

        primaryKey => 'id'

        validate => array()

        validationErrors => array()

        validationDomain => null

        plugin => null

        name => 'VenueLocation'

        alias => 'VenueLocation'

        tableToModel => array(

                'venue_locations' => 'VenueLocation'

        )

        cacheQueries => false

        belongsTo => array()

        hasOne => array()

        hasAndBelongsToMany => array()

        Behaviors => object(BehaviorCollection) {}

        whitelist => array()

        cacheSources => true

        findQueryType => null

        recursive => (int) 1

        order => null

        virtualFields => array()

        __backAssociation => array()

        __backInnerAssociation => array()

        __backOriginalAssociation => array()

        __backContainableAssociation => array()

        findMethods => array(

                'all' => true,

                'first' => true,

                'count' => true,

                'neighbors' => true,

                'list' => true,

                'threaded' => true

        )

        tablePrefix => ''

        [protected] _schema => array(

                'id' => array(

                        [maximum depth reached]

                ),

                'zip_code_id' => array(

                        [maximum depth reached]

                ),

                'metro_slug' => array(

                        [maximum depth reached]

                ),

                'name' => array(

                        [maximum depth reached]

                ),

                'street_address1' => array(

                        [maximum depth reached]

                ),

                'street_address2' => array(

                        [maximum depth reached]

                ),

                'city' => array(

                        [maximum depth reached]

                ),

                'state' => array(

                        [maximum depth reached]

                ),

                'url' => array(

                        [maximum depth reached]

                ),

                'thumb_file' => array(

                        [maximum depth reached]

                ),

                'thumb' => array(

                        [maximum depth reached]

                ),

                'created' => array(

                        [maximum depth reached]

                ),

                'modified' => array(

                        [maximum depth reached]

                )

        )

        [protected] _associationKeys => array(

                'belongsTo' => array(

                        [maximum depth reached]

                ),

                'hasOne' => array(

                        [maximum depth reached]

                ),

                'hasMany' => array(

                        [maximum depth reached]

                ),

                'hasAndBelongsToMany' => array(

                        [maximum depth reached]

                )

        )

        [protected] _associations => array(

                (int) 0 => 'belongsTo',

                (int) 1 => 'hasOne',

                (int) 2 => 'hasMany',

                (int) 3 => 'hasAndBelongsToMany'

        )

        [protected] _insertID => '9'

        [protected] _sourceConfigured => true

        [protected] _eventManager => object(CakeEventManager) {}

        [protected] _validator => object(ModelValidator) {}

}

$created = true

$options = array(

        'validate' => true,

        'fieldList' => array(),

        'callbacks' => true,

        'counterCache' => true

)

$data = array(

        'VenueLocation' => array(

                'metro_slug' => '',

                'name' => 'testing',

                'street_address1' => '---------------------',

                'street_address2' => '',

                'city' => 'lancaster',

                'state' => 'pa',

                'url' => '',

                'thumb_file' => 'Photo on 4-3-14 at 3.20 PM #2.jpg',

                'modified' => '2014-04-03 09:00:22',

                'created' => '2014-04-03 09:00:22',

                'id' => '9'

        )

)

$field = 'thumb'

$path = 'img/venue_locations/1/9.'

$file = 'Photo on 4-3-14 at 3.20 PM #2.jpg'

$extension = ''

$dirname = 'img/venue_locations/1'

chmod - [internal], line ??

UploadBehavior::afterSave() -
APP/Plugin/Upload/Model/Behavior/UploadBehavior.php, line 54

ObjectCollection::trigger() - CORE/Cake/Utility/ObjectCollection.php, line 132

call_user_func - [internal], line ??

CakeEventManager::dispatch() - CORE/Cake/Event/CakeEventManager.php, line 247

Model::save() - CORE/Cake/Model/Model.php, line 1861

VenueLocationsController::add() -
APP/Controller/VenueLocationsController.php, line 51

ReflectionMethod::invokeArgs() - [internal], line ??

Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 490

Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 185

Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 160

[main] - APP/webroot/index.php, line 108


The directory is empty:


www@d8book:~/www.d8book.new/htdocs/app/webroot/img$ ls
cake.icon.png   test-error-icon.png  test-pass-icon.png  venue_locations
cake.power.gif  test-fail-icon.png   test-skip-icon.png
www@d8book:~/www.d8book.new/htdocs/app/webroot/img$ cd venue_locations/
www@d8book:~/www.d8book.new/htdocs/app/webroot/img/venue_locations$ ls
1
www@d8book:~/www.d8book.new/htdocs/app/webroot/img/venue_locations$ cd 1/
www@d8book:~/www.d8book.new/htdocs/app/webroot/img/venue_locations/1$ ls
www@d8book:~/www.d8book.new/htdocs/app/webroot/img/venue_locations/1$ ls
-alh
total 8.0K
drwxr-xr-x 2 www-data www-data 4.0K Apr  3 08:58 .
drwxr-xr-x 3 www-data www-data 4.0K Apr  3 08:58 ..
www@d8book:~/www.d8book.new/htdocs/app/webroot/img/venue_locations/1$ ls
-alh
total 8.0K
drwxr-xr-x 2 www-data www-data 4.0K Apr  3 08:58 .
drwxr-xr-x 3 www-data www-data 4.0K Apr  3 08:58 ..






On Thu, Apr 3, 2014 at 9:20 AM, Asyraf Wahi Anuar <[email protected]>wrote:

> Hi,
>
> I've download the plugin from: https://github.com/Grafikart/CakePHP-Upload
>
> After load the plugin, i created the database with "thumb" column then i
> created this behavior in my model:
>
> public $actsAs = array(
>     'Upload.Upload' => array(
>         'fields' => array(
>             'thumb' => 'img/posts/:id1000/:id'
>         )
>     )
> );
>
> Then, i create this view for form:
>
> echo $this->Form->input('thumb_file', array('type' => 'file'));
>
> After try to save the data from form, it shows:
>
> *Warning* (2): chmod() [function.chmod 
> <http://localhost/ems/salaries/function.chmod>]: No such file or directory 
> [*APP\Plugin\Upload\Model\Behavior\UploadBehavior.php*, line *54*]
>
>
> I've check the database and the "thumb column" shows:
>
>
> /img/posts/1/3.       
>
>
> FYI, i've created the folder img/posts at cakephp root folder. I'm using 
> windows 7 and WAMP server. Is at any issues or anything wrong?
>
>
> Thank you.
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Reply via email to