Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em><strong>Update for future readers</em></strong>. The fundamental problem here was that you must create ASIFormDataRequest items exactly like this:</p> <pre><code>NSURL *url = [NSURL URLWithString:@"https://www.you.com/cgi-bin/you.cgi?stuff"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; </code></pre> <p><em><strong>Do not</em></strong> add in more release, retain, autorelease, self., etc etc! That's all it is.</p> <p>Hmm. I'm not entirely sure the autorelease there is correct. You have to be careful about not losing resuest pointers in ASIHttpRequest.</p> <p>Setting that aside, would it be worth trying it first as a simple (non-queued, asynchronous) request, using exactly this pattern which has been tested billions of times:</p> <pre><code>-(void) sendSomethingAnything { NSURL *url = [NSURL URLWithString:@"https://www.you.com/cgi-bin/you.cgi?stuff"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:@"fakeIDstring" forKey:@"id"]; [request setPostValue:@"anotherCalue" forKey:@"username"]; // your file here .. [request setDelegate:self]; [request setDidFinishSelector:@selector(postFinished:)]; [request setDidFailSelector:@selector(postFailed:)]; [request startAsynchronous]; } </code></pre> <p>Just paste in your URL and you can try that immediately. That will eliminate a lot of problems and get us closer to the problem. In the done routine, get and show the result like this...</p> <pre><code>NSData *newStringData = [request responseData]; NSString *x = [[[NSString alloc] initWithData:newStringData encoding:NSUTF8StringEncoding] autorelease]; NSLog(@"result text from server is %@", x); </code></pre> <p>Finally in your PHP. I find it useful to add a line of code that EMAILS ME from the php stating what the heck is going on. Alternately, use a "wall" command, and just have a shell open on your server as you work with the client. It's the only way to see what the heck is going on as you work.</p> <p>(In fact I use old-fashioned perl rather than futuristic php, so I can't offer any code on that end! :) )</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload