0

I hope someone can help me because I'm frustrating.

I can´t figure out why if I execute :

fileURL = [NSURL URLWithString:@"http://myweb.com/my.pdf"];

then I can display the file correctly in a QLpreviewController

but If I execute

fileURL = [NSURL URLWithString:@"http://myweb.com/download.php?Id=1"]; // is a pdf file

then the file is displayed with encoded characters

Please, anyone can help me ?

Thanks a lot

user1312508
  • 183
  • 2
  • 10

1 Answers1

0

What's probably happening is that the QLPreviewController is identifying the content type from the filename (.pdf) in the first example, but does not have that information in the second example.

If you're using PHP you can probably use a server-side rewrite to make a URL that ends in .pdf (and include the argument in the filename).

Joe
  • 46,419
  • 33
  • 155
  • 245