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

Enable original filename parameter #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nyroDev
Copy link

@nyroDev nyroDev commented May 27, 2021

According to the documentation, an original_filename could be used when uploading a file.
Without it, the full path of the file is used and then shown to the end user, which is not great.

This PR simply enable the parameter to be used when saving the uploaded file as documented.

@noofaq
Copy link
Contributor

noofaq commented Jul 20, 2021

I was just wondering what I am doing wrong.

I upvote the pull request as I would also need to do the same fix

@TimBloembergen
Copy link
Contributor

@nyroDev Sorry for the late response on this issue. I've ran some tests with the sample that we include in the SDK and I wasn't able to reproduce the issue that you mention. On these lines

$data = [
// Will need to create this file for successful test call
'filePath' => 'image.png',
'brandId' => $brandsList[0]['id'],
'name' => 'Image name',
'description' => 'Image description'
];

When passing the data as below, the name of the asset gets set as "PHP SDK Upload", the filepath isn't used within the DAM.

    $data = [
        // Will need to create this file for successful test call
        'filePath' => 'sample/image.png',
        'brandId' => $brandsList[0]['id'],
        'name' => 'PHP SDK Upload',
        'description' => 'SDK upload'
    ];

The original filename doesn't change the name of the actual file but it adds this as an extra field within the Info Pane on the asset detail page.

@nyroDev
Copy link
Author

nyroDev commented Sep 1, 2021

@TimBloembergen I'm not sure to follow you.

My Pull Request add the documented parameter original_filename that is currently not present in the SDK.
On the code you mentionned, you didn't use the original_filename that this PR add.

I understand that regarding final user it won't make many change as the original filename is not used on the DAM side, but for my use case, the original file name is useful for the user as it will give some information on where it comes from.

And it's documented on the API, so why don't support it?

Maybe you want me to also update the sample.php to show how to use the original_filename parameter?

@TimBloembergen
Copy link
Contributor

@nyroDev We can definitely add it as it's part of the API! But it won't solve the issue that you described regarding the filepath being shown to the user. What are you passing as the payload so this happens?

@nyroDev
Copy link
Author

nyroDev commented Sep 1, 2021

It's already part of the API!

My PR just add the necessary in order to use the original_filename documented in the documenation link above.

@nyroDev
Copy link
Author

nyroDev commented Nov 27, 2023

@TimBloembergen I still don't understand what is the problem here.
I'm using this fix for 2 years now without any trouble, I'm enable to specify the filename that will be shown to user, independantly of the filePath used

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 this pull request may close these issues.

None yet

3 participants