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

Attempt to read property "disk" on null" #2

Closed
aligulzar729 opened this issue Aug 28, 2021 · 7 comments
Closed

Attempt to read property "disk" on null" #2

aligulzar729 opened this issue Aug 28, 2021 · 7 comments

Comments

@aligulzar729
Copy link

Dear Sir
When I'm trying to move and validate or any other methods after field() it throws null errors.

Filepond::field($request->input('logo_url'))->validate(['logo_url' => 'required|image|max:3000']);
        $fileName = \Str::random(20) . '_brand';
        $destination = 'uploads/brand/';
$fileInfo = Filepond::field($request->input('logo_url'))
        ->moveTo($destination . $fileName);

Any help will be appreciated.

@rahulhaque
Copy link
Owner

Need more details. Please, provide the following.

  1. Value of $request->input('logo_url')
  2. Screenshot of the error or error file and line number.

@aligulzar729
Copy link
Author

Fixed the previous one but now I'm facing this:
I want to move files to uploads/brand but this happens:
copy(C:\\laragon\\www\\GulfinAPI\\public\\uploads/brand/1630473146_brand_YdFTaOv4DZfPSbXPsxuW.jpg): Failed to open stream: No such file or directory

 // For single file validation
        Filepond::field($request->input('logo_url'))->validate(['avatar' => 'required|image|max:2000']);

        $fileName = time() . "_brand_" . \Str::random(20);
        $path = 'uploads/brand/';
        $fileInfo = Filepond::field($request->input('logo_url'))
            ->moveTo($path . $fileName);

        dd($fileInfo);

@aligulzar729
Copy link
Author

And the value of $request->input('logo_url') is:
"eyJpdiI6IkV1R01BUEd6WFpnZCt5VVJHbFE3c3c9PSIsInZhbHVlIjoiVGhDVytES3hrcmFQd0tyZnRILzB2YUprNVNNSzgzM0t0VXp1bHVmWGZNST0iLCJtYWMiOiI0NzU1ZDU4NDYwMTY3MTNhZmRhZjlhYmZhZDgwNDkxMjcwYWRmMTJiYWM5ZTMzMjQyNDE4NDg2Yjg0N2M4MTE0In0="

@rahulhaque
Copy link
Owner

The folder you're trying to move your files to doesn't exist. Create the folder and make sure you're directing to the correct path.

@aligulzar729
Copy link
Author

aligulzar729 commented Sep 1, 2021

The folder you're trying to move your files to doesn't exist. Create the folder and make sure you're directing to the correct path.

image

It exists in public

@rahulhaque
Copy link
Owner

This is not a package issue. Read more about folder and directory access in laravel. Use public_path helper described here.

@aligulzar729
Copy link
Author

Sorry. But thanks BTW.

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

No branches or pull requests

2 participants