From a browser button I need to convert a chosen graphics file to JPG (if not already) and resize it to 640 pixels wide, while on client side before doing an ftp transfer to the server.

I want to make it upload faster and I would like to do all this in background if I can.

Can anyone provide me with some idea as to how to do this?

Even if the user has to download code and/or click "YES" to some warning, I'm willing to do this if I can. I would like to make it as smooth as possible with the least amount of warnings, but my relationship is with a trusted circle of membership who posts ad listings.