Upload Progress in Wicket for MultiFileUploadField - file-upload

Wickets UploadProgressBar does only work for 'FileUploadField'. This is insufficient for my needs as I need to transfer multiple files which will be added by the User (Just like it can be done with 'MultipleUploadField').
So I'd like to implement an UploadProgressBar which also works for the MultipleUploadField but don't know what would be the best approach to do this. I recognized the classes UploadInfo and UploadStatusResource which might be useful here.
Does anyone have a suggestion what would be the best way to solve this problem?

Have a look at Uploadify at www.uploadify.com, which uses Flash to upload multiple files. You can integrate its Javascript callbacks nicely into Wicket, using Wicket's JS features.
It brings a nice progress bar for each single file upload.
Or you can wait for HTML 5.
Meanwhile you can also check for a better Javscript library for multiple file uploads and again integrate it in Wicket.

Related

How to edit different shopify storefront with one script from Shopify app

My Shopify app needs to edit storefront to change existing element. There are two ways to change storefront code in Shopify
Edit liquid theme file
Add client side JS with Asset API
However, different merchants use different themes in their stores. Is there any way my app works with every theme or how can I write a script which supports maximum themes? It would be very helpful if you can give some hints or share your thoughts about this issue.
After searching more about this issue I got some insights like Unfortunately we can't edit different theme with same script, because each theme might be very different. Some themes might even have different filenames for this sections or they might have completely different HTML structure.
There is no easy and universal way how to solve this problem. One of the ways:
You can do some heuristic in the theme files and try to find a correct place where to insert your code. For example, langify is doing that. It's scanning the whole theme and finding places where to insert their code.
You can ask a customer to add your code manually. Many apps are doing that because it will cause fewer errors. You just need to prepare detailed manual how to set it up properly.
You are wrong, exist more ways.
on storefront 2.0 you can create a theme app extension this is the recommended way today.
UPDATE: On 2.0 you should recommend your customer to replace their section with your section, this is currently the clean and recommended way to do.
On 1.0 well depends a lot on your project complexity or the part on the code your app touch...
Many apps use the theme Rest API, with that you can add on your app installation script a step for downloading the published theme. After that 2 options:
You can search and replace something specific, you can write a script then read the theme files and replace what you need to be replaced, then do the change automatically and republish your changes on the store. Faster no human intervention
use the downloaded code to easily read and replace manually the code using an IDE and after manually upload your changes using the same API. slow, need human intervention but more flexible.
You can start with option 2 now and continue to develop the script for option 1.

Upload Image To Cloudinary Using Java API

I am using cloudinary API with JAVA. We have a requirement to upload images with an auto increasing number automatically. Like 1.jpg, 2.jpg, 3.jpg...
When I upload the first image(abc.jpg) so it would become 1.jpg.
When I upload the second image(xyz.jpg) so it would become 2.jpg. Same for others.
does cloudinary provide any kind of solution for this situation?
This is not supported, this is something that you need to manage by yourself.
Maybe you can rename any uploaded image after receiving the notification URL on your server, but you need to keep in mind stuff like async actions...
Best,
Yakir

Upload a Dropbox file to InkFilepicker

I'm trying to upload a file using the Dropbox API to Ink Filepicker, but I can't find any documentation on doing things like this.
It's done in the backend using Ruby rather than with the Javascript frontend because it needs to automatically upload new photos (Specifically inside the '/Camera_Uploads' folder) as they're added.
Has anyone had experience with doing something like that? One solution I saw was sharing the file, and then uploading them with the Filepicker REST API, but that seems like a bad way to approach this.
I think that your approach of sending a URL to File Picker is a good one, but I would suggest using a media link instead of a share link. Media links expire after four hours, so they're a good alternative to permanently sharing a file.
In Ruby, the method you want is DropboxClient.media.

Multiple files upload chosen in the same browse file window (Ruby on Rails)

I've searched for "multiple files upload in ruby on rails" and the plugins that were suggested always displayed multiple <input type="file" ...> tags. I'm looking for something where I can choose multiple files in the same browse file window, like when uploading photos on facebook.
I've found this one, but it requires some under-the-hood coding to be used in RoR (it is ready for PHP).
My requirements are really basic: I only need to be able to upload files facebook-like. No visual effects needed, or progress bars or whatever. So maybe I'm thinking about implementing my own uploader, but I don't know where to start.
So if you got either 1) a suggestion of RoR plugin that might do what I just described or 2) tips on how to implement one myself, I'd be very glad to hear them.
I've heard good things about Plupload and, to a lesser extent, Uploadify. The former uses a variety of techniques transparently to try and achieve multi-file upload (using the HTML5 API if possible); the latter only supports Flash (though this is what many users will end up using).
Integrating these with Rails is just a matter of implementing the API they expect, which is fairly straightforward.
Here is a post by someone who has taken the effort of making sure CSRF protection and Flash session cookies even co-operate. http://planetrails.com/plupload-with-rails-3
I have not followed that particular guide myself, but it seems correct.
I've had good success with the jQuery File Upload Plugin. It uses both the HTML5 "multiple" attribute for file inputs and drag-and-drop uploading.
If you're using paperclip and jQuery, you can get it integrated in your app pretty quickly.

Crossbrowser Upload progress meter (without SWFUpload please)

Im trying to make a upload progress meter that works on ALL modern browsers in all operative systems (hence that I don't want to use SWFUpload, since all the demo pages fail in my computer, since I use Ubuntu).
Could someone give me please a hint where to look? I've googled the internet up and down without a solution...
Im running a server with PHP, but APC didnt work, apparently doesnt play nice with lightppd. Also I don't know Perl, so I'd rather not having to learn it for this.
I did this using ASP.NET not long ago. Basically, there's no pure HTML way to do it. What needs to be done, is to make changes on your server (in ASP.NET, I wrote an HttpModule to cache the current status of the upload - for PHP, Ruby, etc, there's likely similar methods to plug into).
Then on the client side - when a file was being uploaded, I made periodic ajax calls to the server to access the upload data that the server was caching. Then, using javascript, I would update whatever HTML progress bar.
You can see plUpload : http://www.plupload.com/
If you're using AJAX, you could go with this solution. And here are a few using jQuery.