Discussion Forums  >  Uncategorized

Replies: 17    Views: 360

MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
06/12/11 05:58 PM (14 years ago)

EXC_BAD_ACCESS when I try to submit image for upload to folder on my site for use in gallery (hosted on my site)

Hi all. This has to be something simple and probably a stupid gotcha but hopefully someone has had the same problem. I'm using V1.5 in latest xcode build and running on iOS Device and simulator 4.3 I have a gallery for users to add their pictures to and am using the code / script provided on 'upload' and 'gallery' menus in BuzzTouch. The script works fine when I test in browser and the app will display the images from within the folder that I have added but when I use the 'upload' function on both phone and simulator the app freezes and exits. It happens at the line of code dealing with the image selected when uploading an image to feature in the gallery. So, at this line: NSURL *localImageURL = [info objectForKey:UIImagePickerControllerReferenceURL]; I'm getting this error: Thread 1: Program received signal: EXC_BAD_ACCESS I think I have just put some bad syntax somewhere and it is either getting caught in a loop or doesn't know where or how to send the file to my remote site. The image uploader url I am using is: http://www.mysite.com/ccgalleryimages/gallery.php?deviceId=[deviceId] Where ccgalleryimages is the folder for submitted images and gallery.php is the upload and display provided on BUzztouch? Make sense? Cheers for any input or suggestions.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/13/11 04:54 AM (14 years ago)
Tough to guess, we'll get it. Does the error happen AFTER an image is uploaded (you are able to upload and they are in your folder) or does it happen during the upload, like it never sends the image? I can't do much diagnosing of your upload script because it's on your service. However, there are a few tricks I can step you through if we need to. I can test here too if you post the app name. I'll be a bunch it's your backend erroring then not returning the expected JSON result for fail/success.
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/13/11 04:58 AM (14 years ago)
It happens the MOMENT I select the image, whether on simulator or device. So it never manages to send the image. I can upload when I browse the script via browser and all files are there and the script uploads and views images via browser. I'm being stupid somewhere, too many days away from Macbook! It's the app called 'Celic', simple enough stuff at moment. Don't rush, I'll get back into it as well after a Monday at the office.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/13/11 05:20 AM (14 years ago)
Ok...cool that it's uploading, thats the part most folks get stuck with. I'm thinkig..If I download your project, it will be un-changed and will surely work as-is. You mentioned changing something or breaking something. If you changed some file I'll probably need to know / see / use what you changed. Hmm....maybe zip-it-up and email it when you get to it.
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/13/11 05:59 AM (14 years ago)
Good stuff. All I essentially changed was the folder target in script (leaving out the trailing /) Gallery works on phone and simulator calling images from folder on my site. Upload works and displays all images in folder when navigating via browser. Just boots me out when I actually try to upload via the app. Monday, don't you just love them.
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/17/11 08:47 PM (14 years ago)
Friday again. Slightly better than a Monday! App: Banksy on v1.5 Same thing as above. My Banksy app loads all galleries and receives uploads as tested via browser but will not allow me to upload via app whether it is via the upload screen or via the '+' sign in the gallery nav-bar which is linked to the upload screen. I've used the scripts on the site verbatim and promise I've been through the settings on upload screen a 100+ times. I'm being stupid and missing something. All I have changed in the scripts is the path to the folder online. Can I zip it up and fire it across to you my good man? I'm doing something stupid and can usually figure my errors out by now! Ps If you ever do have a look at it, see what you think about the home page, slightly unresponsive scrolling? I've changed the code to: self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight + 75); and that helped but.....
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/20/11 02:50 AM (14 years ago)
Loooooong weekend. Getting caught up on a tons of posts. I was looking at the Banksy app and checked out one of the image galleries. I just randomly selected one. I noticed that the dataURL for Ja One (this one: http://www.aipple.com/ja1/gallery.php?deviceId=[deviceId]) has JSON with imageName and imageURL's. The app expects one of these values, not both. If the images are in the xcode project, use image names. If they are online, use imageURL's. I'm guessing all your output scripts have both names and URL's, lose one of them ;-) Upload: I just tested you upload script. Doesn't work (unless your doing something funky). I visited it in my browser, uploaded a buzztouch logo and it does not display on the screen. Did it save in your image folder? Also...lose the ?deviceId=[deviceId] at the end of our upload url. The deviceId (and all other variables) are included in the POST variables, not the GET variables. Have a look a the .php script and the BT_screen_iamgeUploader.m file. You'll see the uploader ads a form element for a bunch of items (thes are POST items). Then, you'll see in the .php where the script 'reads' in what was posted. a) Get it to work with the browser first. The uploaded image should display in the list of images after it's been uploaded b) After it works with the browser (I'll test again if you change something) see if the phone works (remove the stuff on the Upload URL i the control panel)
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 04:37 AM (14 years ago)
Will do. Hopefully get it straightened out this PM. Thanks so much David. In the meantime - The main user interaction on the Banksy app comes from users uploading to the user gallery only, no other gallery will allow uploads, they use a gallery display script only. Upload URL is: http://www.aipple.com/usergalleryimages/upload.php Gallery URL is: http://www.aipple.com/usergalleryimages/gallery.php Both seem to work. Speak soon and a thousand thank you's!
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 03:21 PM (14 years ago)
OK. Deleted all previous files and refs on my server and renamed the .php files so as any 'ghost' files were not left. The only gallery in the App that will be accepting uploads is the user gallery located at http://aipple.com/usergalleryimages/ The two .php files tested and working in several browsers are: http://www.aipple.com/usergalleryimages/uploadimage.php http://www.aipple.com/usergalleryimages/viewgallery.php I have the upload screen in BT CP doing the following: The tab 'upload' links to the upload screen. This screen is linked to http://www.aipple.com/usergalleryimages/uploadimage.php there is also a link in the User Gallery (nav bar + icon that links to the upload screen) All galleries work in simulator and on iphone but anytime I click the 'upload' feature I get the following error on BT_screen_imageupload : //get the image name from the selected image NSString *imageId = @; NSString *imageExt = @; NSString *imageName = @; NSURL *localImageURL = [info objectForKey:UIImagePickerControllerReferenceURL]; ******THIS IS THE ERROR******* --> Thread 1: Program received signal: EXEC_BAD_ACCESS if(localImageURL){ NSArray *parameters = [[localImageURL query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@=&]]; NSMutableDictionary *keyValueParm = [NSMutableDictionary dictionary]; for (int i = 0; i < [parameters count]; i=i+2) { [keyValueParm setObject:[parameters objectAtIndex:i+1] forKey:[parameters objectAtIndex:i]]; } imageId = [keyValueParm objectForKey:@id]; imageExt = [keyValueParm objectForKey:@ext]; imageName = [NSString stringWithFormat:@%@.%@, imageId, imageExt]; } I'm a mess!
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 03:24 PM (14 years ago)
Here is a screen shot of the error! http://www.aipple.com/error1.png
 
Jenny21
Code is Art
Profile
Posts: 182
Reg: Apr 14, 2011
USA, Kentucky
1,820
like
06/20/11 04:21 PM (14 years ago)
Hello MacApple, I would like to work with you to resolve this issue. I have yet to read through this thread (I HATE walls of text!) but I would like to ask you a few questions: 1. Does the Image Uploader and Gallery WORK on your Website? 2. Do you think it's possible to send me your BuzzTouch project (the .zip) and allow ME to run it on my devices to attempt to debug the error? I have a read a little of the thread and have noticed that the error is in your app itself 3. Would you like to try another website/hosting? This would allow you to figure out if it's BuzzTouch or your website which has the error. 4. Would you give me permission to access your computer through TeamViewer (google it) if required? Good luck, and thanks! Have a nice day!
 
Jenny21
Code is Art
Profile
Posts: 182
Reg: Apr 14, 2011
USA, Kentucky
1,820
like
06/20/11 04:37 PM (14 years ago)
MacApple, I have read more of your thread and have tried to simulate your experience. I have created a new app with an Image Gallery and an Image Uploader. I'm using my own website for both (when you upload an image, it goes to my website, where it can be viewed in the Image Gallery). After 10 minutes of testing, I can confirm that both features work flawlessy. This causes me to conclude that the error is on your side. IF YOU HAVE NOT modified your BuzzTouch project (THE CODE ITSELF) then MOST LIKELY the problem has to do with your web hosting. Would you like to try option #3 (posted above) and try and use my website for your image gallery and uploader? Of course, as a test! This will allow you to conclude if it is your web hosting or something else. Thank you.
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 04:49 PM (14 years ago)
I appreciate it, just thought you might have had a few issues with this type of thing going from the posts you put on here. I'm a Sales Engineer for a hosting firm so am fairly well versed in a few aspects of IT, just hitting something bizarre here. 1. Sorry you chose not to read the thread before asking questions as Question 1 is answered above, with links. 2. I don't believe you have the expertise to debug the app, sorry! Hope that doesn't sound terribly ungracious but if you hate walls of text......I doubt objective c and dependancies is your forte. 3. In the middle of that right now, was all I could think of today as a final troubleshoot / swap out. 4. There is no need for you to access my computer, I appreciate the offer but not prepared to let anyone have access to my computer. I'm off to drop it on another server and see if the issue doesn't reside there. I'll figure it out. Sorry if the above does indeed sound ungracious but as anyone who posts on here will know I'm not a bad guy, just don't believe it's the way forward. Cheers again Jenny21 and have a pleasant evening.
 
Jenny21
Code is Art
Profile
Posts: 182
Reg: Apr 14, 2011
USA, Kentucky
1,820
like
06/20/11 04:57 PM (14 years ago)
Hey MacApple, I understand all you said, no offense taken. What I meant by #2 was, for me to install the app on my device to make sure it's the app itself and not your device/simulator. If you need, I'll send you my project so you may test it on your device(s). Update me on if you get everything worked out. Thanks!
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 05:41 PM (14 years ago)
Still messing around on one host checking php.ini and flipping it over to another. Lots of donkey work. Cheers again, stay with the thread. I'll zip the app up if you want it just now? NO chuckling at it!
 
Jenny21
Code is Art
Profile
Posts: 182
Reg: Apr 14, 2011
USA, Kentucky
1,820
like
06/20/11 06:19 PM (14 years ago)
I would be glad to test it out for you. Would you like to post the link here, or email me it? I'd recommend you email me. My email is: [email protected] Like I said, I will try and troubleshoot with you. I got it working perfectly fine with my website and app.
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 06:27 PM (14 years ago)
I've had the process working before, that is why it is weird, came back and wallop!
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/20/11 09:21 PM (14 years ago)
Thanks again Jenny21 for the sim thing, will let you know how I get on. Cheers again!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.