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

Feature: Option to add file Link #93

Closed
Metis77 opened this issue Nov 4, 2022 · 3 comments · Fixed by #105
Closed

Feature: Option to add file Link #93

Metis77 opened this issue Nov 4, 2022 · 3 comments · Fixed by #105
Assignees

Comments

@Metis77
Copy link

Metis77 commented Nov 4, 2022

Contao 4.13
PHP 8.1

In the email sent, only the relative path to the files are listed.
Having an option to add the complete URL to link directly to the file would help a lot.

If there is not already a way of doing this (?) that would be an awesome feature.

This issue may be related to #77

@operatorone
Copy link

It would be most appreciated to have the ability to add a link.

@tsarma
Copy link

tsarma commented May 23, 2023

I too wish it functions like a normal Contao Upload File, where Contao provides a link to the file at the bottom of email text.

This is due not availability of $_SESSION['FILES'], when using fineuploader thus the following lines of code from Contao Form.php is not executed.

// Attach uploaded files
if (!empty($_SESSION['FILES']))
{
    foreach ($_SESSION['FILES'] as $file)
    {
        // Add a link to the uploaded file
        if ($file['uploaded'] ?? null)
        {
            $uploaded .= "\n" . Environment::get('base') . StringUtil::stripRootDir(\dirname($file['tmp_name'])) . '/' . rawurlencode($file['name']);
            continue;
        }

        $email->attachFileFromString(file_get_contents($file['tmp_name']), $file['name'], $file['type']);
    }
}

$uploaded = trim($uploaded) ? "\n\n---\n" . $uploaded : '';

https://github.com/contao/contao/blob/4.13/core-bundle/src/Resources/contao/forms/Form.php#L458-L473

@fritzmg fritzmg self-assigned this Jan 25, 2024
@fritzmg
Copy link
Sponsor Collaborator

fritzmg commented Jan 25, 2024

This is a regression caused by #92
In that PR the session usage was removed. However, for Contao 4.13 compatibility, this needs to stay.

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

Successfully merging a pull request may close this issue.

4 participants