Closed verglas closed 10 years ago
Can you give a bit of context as to how you are calling this etc please
// Access data about the file that has been uploaded $data = array( 'name' => $file->getNameWithExtension(), 'extension' => $file->getExtension(), 'mime' => $file->getMimetype(), 'size' => $file->getSize(), 'md5' => $file->getMd5(), 'dimensions' => $file->getDimensions() );
Ah this may be related to #40 - is this being called after the upload has finished?
In the Usage docs https://github.com/codeguy/Upload is before the upload, after create the instance of $file
Yeah - what i mean is, in your code are you calling it in the same place?
Yes, i installed upload with composer, and in the class "\vendor\codeguy\upload\src\Upload\File.php" the methods: getMd5() and getDimensions() are not present.
@merolhack Can you post the specific commit pulled down via Composer?
@codeguy he is correct, they are not in master....
Edit: Ahh i see, you have moved it to FileInfo.php. I did not see that update, docs must just be incorrect maybe?
In composer install: "require": { "php": ">= 5.3.0", "codeguy/upload": "*" },
@merolhack For now, pull down the latest tagged release with "codeguy/upload": "1.*"
.
Mistakenly pushed some new changes to master (untagged). You should be safe pulling down 1.3.1 or 1.3.2. I'll wrap up the new changes tonight and tag a new release with updated docs.
It Works now!! :+1: $ composer update Loading composer repositories with package information Updating dependencies (including require-dev)
@codeguy is this the same issue as #40 then?
@scottrobertson Yes
@codeguy Ok. Let me know if i can be of any help later on.
The changes I made will automatically handle file uploads as an array. Those methods were moved to the new FileInfo class, but I can add them back to the primary File class and return a scalar or array value based on how many FileInfo objects are present.
Yeah, that sounds good to me. It would be good to keep any of them methods (getMd5 etc) out of File if possible.
Call to undefined method Upload\File::getMd5()