-
Notifications
You must be signed in to change notification settings - Fork 83
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
targetFilename parameter evaluation #52
Comments
I too have this issue but with the bucket attribute inside the uploadFile function scope.$eval(attrs.bucket) produces 0 no matter what. However attrs.bucket works fine |
@alexjab that's crazy but you have to use "'42.jpg'", you can do this: ...
$scope.filename = "'42.jpg'";
... Your HTML: <div
s3-upload bucket="'MY_BUCKET'" ng-model="driver.thumbnail"
s3-upload-options="{getOptionsUri: '/api/s3/credentials', folder: 'driver_faces/', targetFilename: filename }">
</div> Because ng-s3upload are using $eval in this property and |
I have this issue as well! It's doing an eval TWICE, once when it reads the opts, then again when doing the targetFilename read which causes the error options input using variable Controller
HTML
First Eval
Second Eval
|
Hi @asafdav ,
I'm using your module for a project at work and I've stumbled on a couple of issues regarding the
targetFilename
parameter.First, when I try to use this parameter, I get some sort of an eval error; here is an example with '42.jpg':
When I try a variable instead (let's say
driver_id + '.jpg'
), the error happens on the value of this id:I had a look at the code and it seems that you are actually evaluating the
targetFilename
parameter line 75 (scope.$eval(opts.targetFilename)
); I think the error comes from there and I don't understand the need for aneval
here;I think that what you get in this field has already been evaluated beforehand, and you get the right value straightLine 29 already evals what's inattrs.s3UploadOptions
.Moreover, there seems to be an issue with the
folder
parameter when used withtargetFilename
: even when present, this parameter is silently ignored. You can indeed see where the issue comes from at the same line as previously 75:At this line, the
folder
param is only used whenever notargetFilename
is provided (the default case).If these two are actual bugs, and if you are interested in a PR, I can create one.
At last, your
README
saysnpm install ng-s3upload
is a way to get the library, but the module does not seem available on npm.Best regards,
Alex
NB: I'm not an angular developer.
The text was updated successfully, but these errors were encountered: