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

Storing hash filename and original filename #63

Closed
munettt opened this issue Mar 2, 2017 · 2 comments
Closed

Storing hash filename and original filename #63

munettt opened this issue Mar 2, 2017 · 2 comments
Labels

Comments

@munettt
Copy link

munettt commented Mar 2, 2017

Hi,

thanks for the great package. I'm wondering if there is a way for me to store both the original filename and a hashed filename?

thanks

@frasmage
Copy link
Collaborator

frasmage commented Mar 2, 2017

Hi @munettt,

Well, you probably only want to have the file on disk once, so pick one or the other to be the actual name of the file. You can easily add additional columns to your table if you need them

$media = MediaUploader::fromSource(...)
    ->useFilename(...)
    ->upload();

$media->hash = md5_file($media->getAbsolutePath());
$media->save();

@munettt
Copy link
Author

munettt commented Mar 3, 2017

Thank you very much!

@munettt munettt closed this as completed Mar 3, 2017
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