Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 07 2021 13:24
    dereuromark commented #46
  • Nov 09 2020 14:36
    jeffersonsimaogoncalves synchronize #46
  • Nov 09 2020 14:23
    jeffersonsimaogoncalves synchronize #46
  • Nov 09 2020 03:22
    jeffersonsimaogoncalves opened #46
  • Jul 05 2020 17:18
    Casmo commented #40
  • Jun 22 2020 14:04

    bobmulder on master

    Use 'fields' from CreatedBy or … (compare)

  • Jun 22 2020 14:04
    bobmulder closed #44
  • Jun 22 2020 12:59

    martonmiklos on master

    Fix null pointer exception in W… (compare)

  • Jun 22 2020 12:59
    martonmiklos closed #45
  • Jun 22 2020 09:18
    coveralls commented #44
  • Jun 22 2020 09:16
    bancer synchronize #44
  • Jun 22 2020 09:13
    coveralls commented #45
  • Jun 22 2020 09:11
    bancer opened #45
  • Jan 28 2020 15:32
    bobmulder commented #44
  • Jan 28 2020 10:14
    coveralls commented #44
  • Jan 28 2020 10:12
    bancer opened #44
  • Sep 19 2019 14:33
    martonmiklos closed #38
  • Sep 19 2019 14:33
    martonmiklos commented #38
  • Sep 19 2019 14:25
    martonmiklos closed #42
  • Sep 19 2019 14:25
    martonmiklos commented #42
danielz
@danielzzz
and in $this->request->data, the field appears as: [
'name' => 'image.png',
'type' => 'image/png',
'tmp_name' => '/tmp/phpcazUER',
'error' => (int) 0,
'size' => (int) 418433
]
Bob Mulder
@bobmulder
Hi @danielzzz, Thank you for your feedback. Did you fix it already, or is there something to do yet?
Bob Mulder
@bobmulder
I have installed the uploadable plugin in a new project and tried it. It works perfectly for me... ;)
However, I've done a new commit to remove the debug calls.
Tomas Gonzalez
@Tomicapo
Hi. I've implemented uploadable behavior successfuly but I found a problem with the directory separator.
I'm on Windows and the URL for the image appears with back slash "\" and of course, chrome isn't able to find the image.
Paul Vaughan
@vaughany
I think I have seen a constant 'DS' (in CakePHP generally, not in this plugin specifically), which IIRC refers to an operating system-appropriate directory separator. This could be used?
Tomas Gonzalez
@Tomicapo
Yes, the problem is that when saving the path, it's saved with the DS instead of a slash "/" which is the correct character for a URL.
So when showing an image that was saved in a windows server, the path appears with a back slash "\" so the image can't be found by the browser.
Paul Vaughan
@vaughany

Isn't the DS constant set differently on different systems? So on my Debian server it's "/" and on Windows it would be "\"?

It sounds like you're saving the path as a string and therefore the / or \ is being saved also, but possibly incorrectly. You need to save the path without the slashes and build the path with the DS constant instead.

Tomas Gonzalez
@Tomicapo
1: Yes, that is correct.
2: The path is being saved by the behavior in this function:
protected function _setUploadColumns($entity, $field, $options = [])
{
    $fieldConfig = $this->config($field);
    $_upload = $this->_uploads[$field];

    // set all columns with values
    foreach ($fieldConfig['fields'] as $key => $column) {
        if ($column) {
            if ($key == "directory") {
                $entity->set($column, $this->_getPath($entity, $field, ['root' => false, 'file' => false]));
            }
            if ($key == "type") {
                $entity->set($column, $_upload['type']);
            }
            if ($key == "size") {
                $entity->set($column, $_upload['size']);
            }
            if ($key == "fileName") {
                $entity->set($column, $this->_getFileName($entity, $field, $options = []));
            }
            if ($key == "filePath") {
                $entity->set($column, $this->_getPath($entity, $field, ['root' => false, 'file' => true]));
            }
        }
    }
    return $entity;
}
I think...
The thing is that on the entity I'm getting the file path but not the URL path. And for showing the image I'd like to have the URL stored.
I apologize if my english is not very good... I'm from Argentina.
Bob Mulder
@bobmulder
Hi @Tomicapo. Sorry for the delay. I've been on holiday. What do you mean with the URL path? I think you can 'build' an url path using the file path?
Tomas Gonzalez
@Tomicapo

Hi, hope you enjoyed your holidays.

Let me show you an example:

  • I upload an image.
  • File path and name are stored in the entity. Ie: "uploads\static_pages\1\news-03.jpg" (notice the back slash "\" because of Windos OS).
  • When I want to display the image on the browser I have to change the back slash into a forward slash. Ie: domain.com/uploads/static_pages/1/news-03.jpg

So, whai we need is:

  • The URL so we can show it to the browser.
  • And the name and path of the file were we stored it (internal, OS dependant) in case we want to delete the file.
Bob Mulder
@bobmulder
In mean time this is done already? :)
Edwin
@EdwinKato
Hi Guys..Nid some help getting this to work..Any one online??
Bob Mulder
@bobmulder
Hey @Ugfighter, I'm here! If you want to report a bug, or discuss a new feature, you can do it here (vissible for everybody). If you need personal help just put it in a private chat with me, so we won't spam the rest ;)
Edwin
@EdwinKato
but i keep getting this errorError: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'avatar' cannot be null
Some one help
Bob Mulder
@bobmulder
Uhm I guess you have multiple columns called avatar in your database?
Edwin
@EdwinKato
Thanx @bobmulder ..You really helped me out
Bob Mulder
@bobmulder
:+1:
tuankiet2605
@tuankiet2605
Hello
everybody
I'm need help
I'm rebuild cakephp 3.x
I'm have problem about plugin cakemanager/cakephp-utils
I'm not know using this plugin
Please, help me via gmail: tuankiet2605@gmail.com
or skype: tuankiet2605
Thank you very much
Bob Mulder
@bobmulder
@tuankiet2605 hi, This chat is used to get he
Help or report problems. Please drop your issue here or chat me privately.
tuankiet2605
@tuankiet2605
Hello
Are you there?
Bob Mulder
@bobmulder
I am
MatthiasBusch
@MatthiasBusch
Hi guys
I am having trouble with the form forcing me to reupload my file everytime I update my model. Is there anything to prevent this?
Bob Mulder
@bobmulder
Hi @MatthiasBusch, can you give me some more details/error logs?
If you don't select a new file, it shouldn't be uploaded...
MatthiasBusch
@MatthiasBusch
I get the error, that the field image can't be left blank
so, the validation already fails, but if I disable the validation, the image path string will be overwritten
Bob Mulder
@bobmulder
That sounds very strange... Please drop me some info how to reproduce this so I can try it myself...
MatthiasBusch
@MatthiasBusch
sure, let me set something up
termlimit
@termlimit
once a user logs in, i am using GlobalAuth to get access to the id in a model. My question is how can i make my CakePHP models similar to this Laravel 4 call: $query = Auth::user()->accounts()->orderBy('accounts.name', 'ASC')
so i dont have to continuously get the user_id from the session, etc for each instance I need to check ownership
anybody getting up and getting out the of the house this weekend?
Bob Mulder
@bobmulder
hi @termlimit! just woke up, ill respond asap