Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not work create .tmb in ftp #3011

Closed
vahidalvandi opened this issue Oct 14, 2019 · 9 comments
Closed

not work create .tmb in ftp #3011

vahidalvandi opened this issue Oct 14, 2019 · 9 comments
Labels

Comments

@vahidalvandi
Copy link

vahidalvandi commented Oct 14, 2019

i use it in laravel

'disks' =>[
    'ftp' => [
        'alias' => 'Cloud Storage',
        'path' => 'public_html/1',
        'URL' => 'https://bk.mysie.com/1',
        'imgLib'     => 'auto',
        'tmbPath'    => 'public_html/1/.tmb',
        'tmpPath'    => 'public_html/1/.tmp',
        'quarantine' => 'public_html/1/.quarantine',
        'attributes' => array(
            array(
                'pattern' => '/\/\./',
                'read' => false,
                'write' => false,
                'locked' => true,
                'hidden' => true
            )
        )
    ]
  ]

it work fine with upload file and create folder but cant create .tmb folder
i work many hour for solve this but i can't solve.
please help me

@nao-pon
Copy link
Member

nao-pon commented Oct 20, 2019

@vahidalvandi Try setting the option tmbURL correctly.

@vahidalvandi
Copy link
Author

please help me

@vahidalvandi
Copy link
Author

vahidalvandi commented Oct 30, 2019

when use it in localhost automatically create .tmp folder but in ftp cant create .tmp folder

same time create .tmp folder in localhost public folder

    'disks' =>[
        'ftp' => [
            'alias' => 'Cloud Storage',
            'path' => 'public_html/2',
            'URL' => 'https://bk.webine.ir/2',
        ]
      ],

@nao-pon
Copy link
Member

nao-pon commented Oct 30, 2019

@vahidalvandi For FTP drives, thumbnails must be stored on a local web server.

@vahidalvandi
Copy link
Author

@vahidalvandi For FTP drives, thumbnails must be stored on a local web server.

oh no .

@vahidalvandi
Copy link
Author

please show Official config for ftp

@nao-pon
Copy link
Member

nao-pon commented Oct 30, 2019

@vahidalvandi If the image content file size is not large, you can treat the image itself as a thumbnail.

'disks' =>[
    'ftp' => [
        'alias' => 'Cloud Storage',
        'path' => 'public_html/1',
        'URL' => 'https://bk.mysie.com/1',
        'tmbURL' => 'self',
        'attributes' => array(
            array(
                'pattern' => '/\/\./',
                'read' => false,
                'write' => false,
                'locked' => true,
                'hidden' => true
            )
        )
    ]
  ]

@vahidalvandi
Copy link
Author

vahidalvandi commented Oct 30, 2019

@nao-pon i solved it with this code but have big problam ,, in each refresh regenerate tmb file


    'disks' =>[
      'ftp' => [
          'alias' => 'Cloud Storage',
          'path' => 'public_html/1',
          'URL' => 'https://bk.webine.ir/1',
          //'tmbURL' => 'self',
          'tmbURL' =>  env('APP_URL').'.tmb',
          'tmbPath' => public_path('.tmb'),
      ]
      ],

also in your code

'tmbURL' => 'self',

why it cant't generate .tmb inside base path in ftp ?? this not good store tmb in localhost

@nao-pon
Copy link
Member

nao-pon commented Nov 30, 2019

@vahidalvandi The file name of the thumbnail is determined based on the file information. Thumbnails are recreated when they change.
You can create a new FTP volume driver with modified functions as needed.

protected function tmbname($stat)
{
$name = $stat['hash'] . (isset($stat['ts']) ? $stat['ts'] : '') . '.png';
if (strlen($name) > 255) {
$name = $this->id . md5($stat['hash']) . $stat['ts'] . '.png';
}
return $name;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants