samayo/bulletproof

This is epic but...

jackttcoms opened this issue · 9 comments

Thankyou for this tool. As one final feature tho, would u be able to add watermarking? It would be most appreciated. Thanks

I don’t feel like this project needs that. It’s not necessary to add bloat that hundreds of other libraries already handle.

This handles the “as safe as possible” upload of files and I feel like that’s how it should remain.

I don’t want to speak for the project maintainer but I imagine they’ll share this view.

Of course watermarking is possible, did the two of you even read the readme 😂 ?

Inside the src/utils folder, there are three php files, each one of them contain one function, for cropping, resizing and watermarking images

Check the link, watermarking is super easy and also bulletproof :)

Thank for the nice words and I agree with @twistedpixel about keeping the class a single purpose for safe upload

Haha, my bad - I forgot this was already a feature! It has been a while since I worked with this project!

My bad too. Apologies and ye I agree simple but secure is always better!

Thanks for this epic script.

Thanks again

Got it all working now 👍

Also one question does it do Base64 decoding automatically? Just thinking about the mime type etc. I am using Croppie so once cropped it puts it in base64 so I need to decode that and then verify the file type so how would i go about this? Is that possible? Base64 decoding? file_put_contents() ?

Oh and... chunked uploads. Is that possible or will I need to do some editing. Thanks again.

Thanks

There are no base64 implementation for this library, again the idea was to keep it simple, but you can find a way to get the base64 once you upload the image, so it is easy.
As for the chunk upload, if you mean multiple upload, there isn't a built-in function for that but it should be easy, there was even one or two questions on SO, here is one https://stackoverflow.com/a/52636402/1640606

Read the src, you will understand better the library and modify it to your needs if you want

closing this issue, if you need more help, feel free to ask again

Ye Chunking: https://github.com/callesg/BigUpload

It basically works around the php.ini limits and allows massive files to be uploaded relatively quick.

And with base64 you do the file_put_contents() but obviously I want to use your amazing validation checking to keep everything secure. How do you suggest I utilise your script while doing the base64. I would use a different method but Croppie is a great JS Cropping script.

Thanks so much.

This is a bit cimplicated situation, so I suggest you ask in SO and share the link here maybe, and then I can take a look.

Since it is an issue I haven't considerd before I don't think I can give you a good solution. If it was upto me I would probably alter the class and add a base64 after the upload, but that would be a quick hack