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

FileNotFoundException when uploading PDF #95

Open
MatthewRuddy opened this issue Dec 11, 2015 · 4 comments
Open

FileNotFoundException when uploading PDF #95

MatthewRuddy opened this issue Dec 11, 2015 · 4 comments

Comments

@MatthewRuddy
Copy link

Hey. Been using this package for a while now, working well until recently. For a particular model I'm using a PDF as an attachment.

Works fine with image file types (jpg, png, etc). But PDF's throw the error below. Getting this same error both locally and on my server hosted with Digital Ocean managed by Laravel Forge.

screen shot 2015-12-11 at 02 38 20

@tabennett
Copy link
Contributor

I've never had any issues uploading pdf's with this package. Are you defining styles for the attachment that you're uploading the PDF with?

@NightZpy
Copy link

Maybe 'files' => true in the form definition?

@gravitano
Copy link

Hello, I have some problem regarding this issue. Any update for this?

@fukuyama-ej
Copy link

I have some problem too. this problem was occured when hasAttachedFile have styles options

this is not good

    $this->hasAttachedFile('pdf', [
        'styles' => [
            'thumbnail' => [
                'dimensions' => '300x300#',
            ],
            'icon' => [
                'dimensions' => '64x64#',
            ],
        ]
    ]);

it works fine

    $this->hasAttachedFile('pdf', [
        'styles' => []
    ]);

at codesleeve/stapler/src/Attachment.php , protected function flushWrites() {}

$this->move($file, $filePath); causes this problem because if non image file of $file var is just, temporaly uploaded file of php system . so, only just 1time works fine. but next loop, this tmp file was gone by $this->move() .

I think need skipping for this loop if non image given and style dose not original like this

protected function flushWrites()
{
    foreach ($this->queuedForWrite as $style) {
        if ($style->name != 'original' && !$this->uploadedFile->isImage()) {
            continue;
        }

Thanks a lot.

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

5 participants