-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
allow upload of blob #208
Comments
Hi. Thanks.
Blob uploading is possible. You can pass any data with file. Probably, in your case it looks like this: // client
uploader.onAfterAddingFile = function(item) {
item.formData.push({name: item.file.name});
}; // server
$name = $_POST['name'];
I can write something like this form.append(item.alias, item._file, item.file.name); insted that code. What do you think about it? |
Yes @nervgh, changing this line of code is what I meant ;) |
yes, I know that, but I don't want it to pass it with the file, I want to just upload a Blob... that's why I overwrite item._file before the upload ;) |
Thanks =) |
@lpsBetty @nervgh Do any of you have a functional example of using ngImgCrop together with this uploader? I just can't make it work. |
hey @TrkiSF2, I used onBeforeUploadItem to overwrite the actual '_file' with the blob: updated solution, if you have a scope inheritance problem: https://gist.github.com/lpsBetty/2057e0bd0b4142d4070db0e1175ca47e
and the HTML:
I hope I can you help you with that snippets ;) |
IpsBetty thank you for the code! I will try it when I come home but from a quick view I am missing one thing. When do you call something like $scope.uploader.addToQueue(item) and how the item object looks like in that state please? |
the uploader is bind to the dropzone and to the input field in my HTML. |
Thank you very much. I made it work finally!!! :) If you would like to stay in touch https://twitter.com/TrkiSF2 |
@lpsBetty , thanks =) |
Sorry to continue this thread that's already long - @TrkiSF2, any chance you could post your working code as a Plunkr or similar? @lpsBetty - thank you SO much for posting your code. I'm just curious what the HTML context is for the upload directory? I realize that we're saving the base64 encoded image string to Maybe someone can share what wraps the example crop code from here:
@nervgh - I spent days recreating this functionality in raw javascript, and got it working. However, this directive is so well written and documented I'm definitely tossing that work in favor of this library. Great documentation, robust eventing, and modular / flexible - Thank you!!! |
Ugh, sorry for the stupid question (though I think the full HTML template would still be great to post). Turns out I was just missing the CSS which is required for the .cropArea {
background: #E4E4E4;
overflow: hidden;
width:500px;
height:350px;
} |
Thanks again @lpsBetty! I had to make some changes to accomodate multi-file uploads, I think your code was assuming singular. For anyone else that wants to see all the moving parts, I've created a public gist that wires it all together: https://gist.github.com/brianfeister/56a1c6c77cd5928a1c53 |
@brianfeister yes i just needed single file upload, thanks your gist 👍 |
Hi @nervgh |
Hi @chin2, there is a property called just set it to |
Thanks @lpsBetty 👍 |
Hi, @lpsBetty, @nervgh |
@chin2 So you want an image already in the queue? why do you want that? |
@lpsBetty Actually while edit form, the uploaded image should be rendered. Have you got idea what is want exactly? |
@chin2 so you want a preview? just use the
|
angular-file-upload how to add an parameter in url? |
TH's @lpsBetty |
Hi, |
@enuelmorales-snoop where is this error coming from? |
Okey, mi view code is: < img-crop image="myImage" The problem is when I mouseup on the corner the console log return " Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted. " and |
@enuelmorales-snoop I think you are posting in the wrong issue here, this is the angular-file-upload and not the img-crop repository. |
There is a way to get this work if autoUpload is set to true? |
@braindrained I don't understand, do you want to upload the image immediately before cropping? |
@lpsBetty let me explain, I use angular file upload just for upload images, now I resize the image (maxWidth/maxHeight) in the backend. |
@braindrained Sorry, I am still not sure what you mean. Why do you need to upload a blob? If resizing the image in the backend you can just upload the image via autoUpload and that's it? |
@lpsBetty lol maybe I'm not explaining it properly (this is not my language :) ). I've an application already working with the resize made in the backend. |
@braindrained and what do you use for cropping? just see this code for uploading a blob: https://gist.github.com/lpsBetty/2057e0bd0b4142d4070db0e1175ca47e |
@lpsBetty I've already tried your method but it does not work. I resize the image this way:
|
@braindrained I think you do not need a I am not sure if this is the right place to discuss this, and I do not want to expand this closed issue! |
I agree, thanks anyway. |
Thanks for this thread. Exactly needed this solutions 💯 |
For anyone who just wants to upload a blob file without extra data and does not care about compatibility with IE9 (and maybe IE10?) see #602 |
Hi @lpsBetty
And my html is below.
So in order to edit existing photo id, user will click photo id of user.
Could you please help me to fix this issue? |
@blueror815 I don't know why you need this IF shouldn't the uploader always have an item in the queue, when an user selects an image? and please use the latest solution: https://gist.github.com/lpsBetty/2057e0bd0b4142d4070db0e1175ca47e |
hi betty...AM just getting stuck on this.
HTML: |
|
@FURQAN2050 can you please describe your problem? I recommend using the latest solution from here! |
Thank you so much betty....it works perfectly fine.:)
…On Fri, Jun 22, 2018, 2:57 AM Bettina Steger ***@***.***> wrote:
@FURQAN2050 <https://github.com/FURQAN2050> can you please describe your
problem?
It would help to know the problem, before reading and understanding your
code ;)
I recommend using the latest solution from here
<https://gist.github.com/lpsBetty/2057e0bd0b4142d4070db0e1175ca47e>!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#208 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AedArhCJfTgkao44XrVqO1sSFMKs_yzdks5t_BbLgaJpZM4CWg5K>
.
|
betty are you there?
…On 23 June 2018 at 20:12, Furq Djrian ***@***.***> wrote:
Thank you so much betty....it works perfectly fine.:)
On Fri, Jun 22, 2018, 2:57 AM Bettina Steger ***@***.***>
wrote:
> @FURQAN2050 <https://github.com/FURQAN2050> can you please describe your
> problem?
> It would help to know the problem, before reading and understanding your
> code ;)
>
> I recommend using the latest solution from here
> <https://gist.github.com/lpsBetty/2057e0bd0b4142d4070db0e1175ca47e>!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#208 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AedArhCJfTgkao44XrVqO1sSFMKs_yzdks5t_BbLgaJpZM4CWg5K>
> .
>
|
my ng file upload is not uploading the same file twice ....do you know any
thing about that?
…On 28 June 2018 at 12:53, Furq Djrian ***@***.***> wrote:
betty are you there?
On 23 June 2018 at 20:12, Furq Djrian ***@***.***> wrote:
> Thank you so much betty....it works perfectly fine.:)
>
> On Fri, Jun 22, 2018, 2:57 AM Bettina Steger ***@***.***>
> wrote:
>
>> @FURQAN2050 <https://github.com/FURQAN2050> can you please describe
>> your problem?
>> It would help to know the problem, before reading and understanding your
>> code ;)
>>
>> I recommend using the latest solution from here
>> <https://gist.github.com/lpsBetty/2057e0bd0b4142d4070db0e1175ca47e>!
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#208 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AedArhCJfTgkao44XrVqO1sSFMKs_yzdks5t_BbLgaJpZM4CWg5K>
>> .
>>
>
|
@FURQAN2050 do you clear the queue after uploading? is there an error or what happens when you reupload the same file? |
There is no error when i reupload the file...but when i select the
file.then cancel it .and trying to upload the same file...it is not
showing. :(
…On Thu, Jun 28, 2018, 12:59 PM Bettina Steger ***@***.***> wrote:
@FURQAN2050 <https://github.com/FURQAN2050> do you clear the queue after
uploading? is there an error or what happens when you reupload the same
file?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#208 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AedArr1h6RSrmLtq3jizB4eDQJQa3e9Rks5uBIzhgaJpZM4CWg5K>
.
|
can you come on skype please..just for while
…On 28 June 2018 at 13:04, Furq Djrian ***@***.***> wrote:
There is no error when i reupload the file...but when i select the
file.then cancel it .and trying to upload the same file...it is not
showing. :(
On Thu, Jun 28, 2018, 12:59 PM Bettina Steger ***@***.***>
wrote:
> @FURQAN2050 <https://github.com/FURQAN2050> do you clear the queue after
> uploading? is there an error or what happens when you reupload the same
> file?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#208 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AedArr1h6RSrmLtq3jizB4eDQJQa3e9Rks5uBIzhgaJpZM4CWg5K>
> .
>
|
am unable to get the error.
…On 28 June 2018 at 13:06, Furq Djrian ***@***.***> wrote:
can you come on skype please..just for while
On 28 June 2018 at 13:04, Furq Djrian ***@***.***> wrote:
> There is no error when i reupload the file...but when i select the
> file.then cancel it .and trying to upload the same file...it is not
> showing. :(
>
> On Thu, Jun 28, 2018, 12:59 PM Bettina Steger ***@***.***>
> wrote:
>
>> @FURQAN2050 <https://github.com/FURQAN2050> do you clear the queue
>> after uploading? is there an error or what happens when you reupload the
>> same file?
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#208 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AedArr1h6RSrmLtq3jizB4eDQJQa3e9Rks5uBIzhgaJpZM4CWg5K>
>> .
>>
>
|
hey I just used https://github.com/alexk111/ngImgCrop to crop an image before uploading.. and now I did this to upload the blob with angular-file-upload:
This works just fine, but the file name is ignored because of this line: (and because of that the server doesn't recognize the file extension)
It would be possible to add the name as third parameter, see https://developer.mozilla.org/en-US/docs/Web/API/FormData
what do you think of adding a third parameter or allow to upload a Blob in the first place?
btw: you made a really cool plugin!
The text was updated successfully, but these errors were encountered: