ASP.NET file upload progress bar - asp.net

I've tired looking for an example of ASP.NET file upload progress bar without using flash or silverlight or ajax (just using iframe).
Can anybody help me?

NeatUpload is a pretty good solution. Depends on your definition of Ajax, but it does full page reloads with iframes and interpolates inbetween.

I'm not sure you can do it without some Ajax or some other mean (flash, silverlight...) to query the server periodically for the status of the upload. Normally, browsers don't provide upload status in a form you can read on the client side with javascript.
Unless what you need is just an indefinite "loading" animation (that provides no information on the real progress of the upload)

I ran into this same problem at work recently and ended up having to roll my own, simple C# file upload user control. The code is found on github here:
https://github.com/CBCMusic/ajax-file-uploader
It uses an existing JS library to handle the progress bar & XHR2 file upload, and downgrades nicely for older browsers. No flash, just HTML5. Hope it helps...!

Related

How to edit images using javascript in real time and save the edited image on the server?

Is it possible to edit images using a javascript library and then send the edited image to the server for saving.
Edits will be in real time, means the user can see the edit result in the same time he is editing without the need to refresh the page.
I want a javascript library to do some edits on an image on a webpage 'such as crop, resize, rotate,...' and send send the edited result to the server.
How this can be done or if there any smart work around to something like this.
The libraries mentioned don't seem to be fully cross browser. As far as I know there is no fully cross browser compliant way to edit pixel data on the client.
The current best approach would be to do these manipulations on the server. You can still do this real time using a web service.
As an example see the image editor in TinyMCE which supports crop, rotate, resize, flip, all from the client without a page refresh.
Pixastic is an image manipulation library; once you've modified the image, some sort of post back / upload call from the script will be able to upload the image provided you've implemented the needed functionality to do so.
An incomplete list to be sure, but these are two that come to mind which allow you do a wide variety of editing on the client side and push back to the server.
PIxastic
AIE
And there are numerous less complete image editing tools for simply cropping or adjusting contrast as well.
jcrop is what you are looking for .

Multiple file upload with preview

Is there any good control or plug-in for uploading multiple photos with preview? As far as I understand it is impossible to preview photo on local computer using just JavaScript. So it has to use Flash or Java.
Thanks, also, I use ASP.NET.
Wait, do you mean show it in a browser window before starting the upload? So does the file have a URI? (Hint: file:///c/users/public/somefile.png is a URI) You can always just link it into an image tag on their browser session.
Now, will a browser let you link a file:/// for image? That I've not tried, but you should; at least you'll learn something from it when you do try.
But using this, there's no reason you can't use a lightbox style image viewer with the local URI.
You could also make use of silverlight 4. If you're looking for something already written you might try using the upload control from gallery which much require some hackery or if you have money to burn then telerik have an upload control but I don't believe it supports previews. This http://www.aurigma.com/Products/ImageUploader/ also looks nifty.

Image preview in Flex

I am working on an image management application. We have an Adobe AIR client talking to a WAMP server. The MySQL DB stores the images as blobs.
We have an image search feature. Upon searching, I am displaying the results as XMLList in a popup window and provided a download button. Downloads work fine. I also want to add a preview button to the popup.
Please let me know how can I code this. Without having the file on the client, I cannot preview. But when I use save() method, the os dialog opens up. Anything to be done on the PHP side?
Please help.
Regards
Jad.
Don't you mean to display an Image? Wouldn't the normal work? Of course, for performance issues, your PHP code must render smaller images (thumbnails).
Correct me if wrongly understood your question. :(

JQuery source script causes "A script on this page is causing Internet Explorer to run slowly." message

One of the web pages on our site is extremely long. Although the page itself does not call any javascript or jquery functions, its base page registers the JQuery source script (jquery-1.2.6.js) and this seems to cause IE7 to display the "A script on this page is causing Internet Explorer to run slowly." message when you click on a link that will navigate you away from this long page.
Removing the registration of the jquery source script makes the problem go away, however there are other controls on the page that require jquery so this is not really an option.
Any ideas why this happens and is there any way around it?
Thanks.
As a crude workaround, could you unregister the script on the child page?
Did you try moving the script reference to the bottom of the page?
It looks like when you click on a link the JQuery source functions do some processing involving an array of the elements on the page. When the page, and therefore the array, is very big it triggers the IE warning.
I guess I'll have to live with it or persuade my business to drop the option that builds the enourmous page.
If it is worth it to you. you could try to optimize the jquery calls. there are some simple techniques that could really improve performance on large pages.
//cache any jQuery objects that are used frequently
$myObj = $(".someClass");
...
Also think that this is still relevant: Optimizing DOM Traversal

Why do browsers not have a file upload progress bar?

I wonder why no browser out there has such simple but essential feature. Am I missing something? Is there a technical reason?
I'm tired of all those javascript/flash/java hacks out there ...
There is no technical reason preventing the browser from calculating the total bytes to be sent and then tracking how many have been received by the server (Thanks, Kibbee for your comment). Firefox had a functional upload progress indicator until version 0.9, but that build broke it in 2004.
Reading through the Bugzilla updates, it seems that this feature doesn't seem to benefit enough users to get any traction from the developers.
Users who regularly upload very large files tend to use tools like FTP that are designed for this purpose, so they are not affected.
Adding to flamingLogos argument, you might operate behind a proxy which takes your five megabytes of pure goodness within a second, and then sends it off to the server over a 56kbit modem.
I perceive a wrong progress bar slightly worse than no progress bar at all, and there would be many people for who it would be wrong all of the time.
Yes, it's silly, and for some reason browser makers are ignoring it.
I would strongly dispute that large file users use FTP - hardly anyone knows about that anymore and all the common Web apps require HTTP uploads for video, audio and pictures (e.g. youtube).
Ironic that user participation and media is the key to Web 2.0, yet the main mechanism for user participation is so poorly handled by browsers.
For Firefox there have been bugs languishing for years, such as for a better upload progress display:
https://bugzilla.mozilla.org/show_bug.cgi?id=243468
Get voting! :)
The existing progress bar in the status bar is broken for years - see bug 249338 - and it will let you silently abort an upload - see bug 432768.
If you are using Firefox, you can use the new UploadProgress add-on https://addons.mozilla.org/en-US/firefox/addon/221510/ designed for this purpose, that is displaying the progress of your uploads and an estimated remaining time.
You have to post back to upload a file, regardless of whether or not you are being "sneaky" about it (using hidden iframes, for example); the browser's own progress bar (usually down in the status bar) is the file upload progress bar in that sense, although not exactly.
It's just that you can't easily use that data for yourself, so you have to approximate it with a lot of client-to-server communication tricks.
There's no real technical reason you couldn't have a reasonable progress indicator as you do with downloads. You should suggest it as a feature request to your favorite browser.
That said, I think the main reason there are so many javascript/flash/ajax-based upload components isn't so much to provide progress bars (though that's a nice bonus). It's usually because they want to provide a better UI for selecting the data to be uploaded and to sometimes manipulate the data before uploading. The basic file upload feature that's in the HTML specs results in the "Browse..." button that pops up a file open dialog and uploads the raw file data as is to the server.
Chrome has an upload bar that shows the % of loading.
Or, like Peuchele says, there's also an Addon for Firefox.
The web browser has always been that, a browser of the web. It is a mechanism for consumption. Our ability to upload information through the same portal is somewhat of a hack.

Resources