|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello all, this is my first post.
Well i've been struggling with this: is there a way that in my server in the cgi-bin where i put my PHP script or whatever cgi that loads an image file (image/jpeg) and send it trought the cgi/php script to name the output file? cuz when the user downloaded the image the default name of the saved image is the php/cgi name. is there a way to change it? i tried "content-type: image/jpeg" + EOL + "Content-Disposition xxx" xxx = what ever common syntax i tried, with no luck. if there is a solution i would gladly happy. thank you. |
|
#2
|
||||
|
||||
|
hi there, welcome onboard the devshed wap forums, nice to have someone else here.
some phones will reject images that are linked to as file.php as the extension of the url being called does not match the mime type you need to output so it would be better to do some url rewriting and have the user click a link like my-download.jpg which would then execute your PHP in the background. then inside my-download.php you'd need to propagate this with some values: PHP Code:
hope this helps.
__________________
Andy Moore << oh no it's got a blog..... Word Press WAP Plugin with Ad Mob Advertising revenue PHP developer deploying ringtones, mp3 downloads and realtones I'm a geek who's obsessed with stats and gadgets |
|
#3
|
|||
|
|||
|
well i tried your header and it doesnt work.
also, you use content-type twice? and in the first line there is no \r\n and in the thirs there is \r\n\r\n and then the second time content-type you script might be working if it will be in the correct formatting (which i try here and there with no luck) if there is a way to pull this off it will be great! so far no luck ![]() |
|
#4
|
||||
|
||||
|
www.php.net/header
www.php.net/file www.php.net/file_get_contents There's loads of inbuilt functions which will help you work this out, the \n\n\r and so on all contribute to a part of that script I didn't post which renders the files to the handset wrapped in open mobile alliance digital rights management 1 - or forward lock.... But that's for another time.... The PHP site has all you need on there really. Hope this helps. |
|
#5
|
|||
|
|||
|
Hi andymoo,
Soz to drag up an old topic, but you mention wrapping the image in drm forward-lock...I think the "another time" is now! I've been trying to dish out some images with forward-lock enabled, but with absolutely no luck so far Any chance you could share the php code with me if that's possible before it drives me insane!? The code i've tried so far (found in a forum post elsewhere) is as follows: PHP Code:
Alas that doesn't do the trick ![]() Thanks for any time you can spare! |
|
#6
|
||||
|
||||
|
sorry not a cat in hells chance. it took me ages to get the right code to drm something and there's no way i can give that away on a forum.
it's worth too much and took me too long to do. even if you do figure out drm you still need to know when NOT to use it......... |
|
#7
|
|||
|
|||
|
Er, thanks. I've sorted it now anyway. Basically had it, just a minor issue with some linebreaks
![]() Last edited by aleco : December 19th, 2006 at 06:46 AM. Reason: typo |
|
#8
|
||||
|
||||
|
that's the fun part of it. working out if it should be /r/n or /n/n or /r/n/r and that's the bit that seems to vary on different phones....
i finally sussed it some time back at 03.00 am and woke the girlfriend to say i'd cracked oma 1 - she just looked blankly at me and returned to sleep. can't understand why she never shared my enthusiasm. drm would be okay but not all phones support it so it's as good as it gets but pointless if the device isn't going to do anything with the drm wrapped file. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Mobile Programming > WAP and Content-Disposition |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|