Classic asp and iphone/android picture upload + resize

Hello all,

I have a question with regard to upload photos from the picture gallery from an iPhone/Android device. . I want my customers to be able to upload photos directly to my database using classic asp (yes, I'm that old). I'd prefer that if possible the script/code or whatever required to obtain this would also autmatically decrease the size of the picture so it would not exceed a certain amount of mb. Is this at all possible/feasible? Creating an app would definitely be the way to go, but I lack the skill to do it and the time to learn it.

Any help/input much appreciated!
mambechAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

serialbandCommented:
There seems to be some free code http://www.motobit.com/tips/detpg_asp-resize-image/
or some paid software for resizing pictures trough asp http://www.chestysoft.com/imagefile/default.asp
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
There are several parts to your question and as many options (if not more).

1) Uploading photos the picture gallery from an iPhone/Android device.

2) to be able to upload photos directly to my database using classic asp

3) script/code or whatever required to obtain this would also automatically decrease the size of the picture so it would not exceed a certain amount of mb.

>Is this at all possible/feasible? Creating an app would definitely be the way to go,

Creating an app would be the way to go.  However, if you are using Classic ASP, I am going to go out on a limb and guess you like using this language because it is easy, no special IDE is required and you just know it... and there is nothing wrong with that.   However, to answer your question, "is it feasible?", I would say that depends.

First, understand that when you have a website where you are using Classic ASP, the ASP/Vbscript or Jscript is running on your server that you control.  You have (should) certain functions in your server side code that help protect your database (which also probably resides on your web server), sanitize input data, perform calculations and perhaps generate html.
response.write "<div class="col-sm-6'>Column 1</div>"

Open in new window


A mobile device using a native app is different in that it is the server so to speak. You wouldn't put your code or your passcodes protecting the database on your server on somebody else's would you? Hopefully no.  Therefor, writing a native mobile app is going to be different than what you are used to and you will need to develop two separate apps.  One for IOS using the language Swift https://developer.apple.com/swift/ and the other for Android using java http://developer.android.com/tools/studio/index.html.   This means you now need to learn two new languages.  Plus if you are not proficient in javascript/jquery already, you should brush up.  It is probably not common that developers are working in both IOS and Android. Typically you would develop in what you are most comfortable (if any) when that is working, hire somebody to develop for the other platform or learn that as well.  Both will have a good learning curve.  

Beyond just working with new languages, you will need to interact with your database differently as well.  You could set up a faux web service using Classic ASP or create a webservice using SQL Server.  A lot of new things to learn.

Another option is to use Cordova https://cordova.apache.org/ (formerly PhoneGap).  Cordova allows you to develop your app in  in HTML, CSS as you are used to. Still going to be a learning curve, probably not as steep as a native app.  Many people start out using this because it is much faster.  Because of the abstraction, some functions such as clicking things can have a slight delay compared to native.  I think once you get an app out with this, you want to move to learn native.

There is a third option that will be the easiest for you and that is to create your app as you normally would using classic asp and put it into a webview.  http://developer.android.com/guide/webapps/webview.html.

Think of a webview as an iFrame. You create a native app that simply brings your website. There are some gotchas and you will want to read through the example and make yourself an easy test. Any of the services that you see that claim to convert your site to an app use this very function.  Just make sure your web pages are responsive.  http://getbootstrap.com/ http://foundation.zurb.com/ If they are not responsive, your users will have to do a lot of scrolling and will not be happy.

The final option is to just make your site responsive and be done with it.  

>Uploading photos the picture gallery
The first option there is specific code for this just as you have specific code for handling images on your own server.   The other options a user will select an image as they are used to that is from one of the galleries on their phone. No special coding for that on your end.  

>to be able to upload photos directly to my database
For the first option you would probably convert the image to base64 and store that code to your db.  Otherwise, send to your server and just store the location of the file on your server in your db. For native apps, it is probably more typical to store your actual  image in the db.  There are API's for each native app to do this.  

To complete this via a webview/website, again, you could use your asp code to convert to base 64, then save to your db, or use one of the Classic ASP dll's to upload to your server. http://www.aspupload.com/,  http://www.chilkatsoft.com/upload-activex.asp, http://www.motobit.com/help/scptutl/pure-asp-upload.htm.  There are questions here on EE for all three.

>automatically decrease the size of the picture so it would not exceed a certain amount of mb
Same as Upload, the Native API's will have this feature.  For classic asp you would use http://www.aspjpeg.com/ or http://www.imagemagick.org/.  ASPJpeg, is very easy to use, I think it costs $200. If you are on a shared hosting service, there is a good chance they already have this installed.   Imagemagick is software you install. I have seen some shared hosts have this. If you are on a shared host and they don't have it, you will not have access to it.  It is free and you access it via the command line.  I use this myself for both PHP and ASP. I have also used ASPJpeg.  While ASPJpeg has a price, it is worth it for the short learning curve and overall ease of use.

You do have some choices to make as to how you want to proceed.  If you want to give the best user experience, then you want native apps.  If you want the fastest to market, use your website but make it responsive or at least put it in a webview.   My opinion would be to start out with making a responsive site.  Once you are happy with it, the next step is a webview.  Later on, progress to Cordova if you want to do some more learning.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mambechAuthor Commented:
Absolutely phenomenal detail in this answer! Great!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.