1

I'm building an asp.net website using c# and .net 2.0. One of the pages requires to take a picture (or choose from already existing pictures), upload it to the server, add other info and save everything in the database.

I'm using a FileUpload control and everything is working fine on a PC.

Android gives me the options to choose a file from Gallery, File system, Music Track etc. but there is no option to take a picture from the camera. The FileUpload control is disabled in iPhone.

I want to click on a button or use something else and be able to choose to upload an image from the gallery or start the camera and take one. Is there a way to do it?

Thanks!

rampage
  • 25
  • 1
  • 3
  • possible duplicate of [HTML file browse not working in iPad](http://stackoverflow.com/questions/6463818/html-file-browse-not-working-in-ipad) – Craig Stuntz Jul 11 '12 at 14:16
  • I don't think you can do that. native HTML5 doesn't support camera integration (yet) – Shai Jul 11 '12 at 14:16
  • @Shai: It's not an HTML 5 issue, really. Safari just doesn't support file inputs prior to iOS 6. – Craig Stuntz Jul 11 '12 at 14:18
  • Yeah, but it is possible to use the camera using HTML5, and, lets say, PhoneGap... I was referring to the camera issue (-: – Shai Jul 11 '12 at 14:20
  • @Shai: Again, this works fine on Android. I suspect it will work on iOS 6, as well. It's a limitation of Mobile Safari, nothing more. Also, rampage: Android 4 ICS allows you to take a picture with the camera. – Craig Stuntz Jul 11 '12 at 17:00

1 Answers1

-1

Allowing the user to choose a picture from the gallery or take a new picture (if the device supports photography) both exist within the same class. That class is named UIImagePickerController and has a property named 'sourceType' that allows you to designate whether the user will be taking a photo, choosing from the gallery, etc.

-edit-

This is for iOS

esreli
  • 4,993
  • 2
  • 26
  • 40
  • Can you please give me some idea on how to implement this is my asp.net web site? Thank you! – rampage Jul 11 '12 at 14:52
  • you have to build a native app – esreli Jul 11 '12 at 14:54
  • Are there any free already built solutions that I can use since I have absolutely no idea of Objective C coding. Are there any other solutions because I think that not everyone would want to install an app to use this feature (I have hardly any experience with iStuff). – rampage Jul 11 '12 at 15:04
  • I found this link in another question, I think it addresses your need: http://code.google.com/p/iphone-photo-picker/ – esreli Jul 12 '12 at 15:01
  • I will delete this answer because I know it is not what you are looking for. I compiled a better another better answer that I think addresses your need. – esreli Jul 12 '12 at 15:06