Jump to content

magnav0x

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

magnav0x's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=366101:date=Apr 18 2006, 12:58 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Apr 18 2006, 12:58 PM) [snapback]366101[/snapback][/div][div class=\'quotemain\'][!--quotec--] if ($_FILES['userfile']['type'] == 'wmv' or 'mpg' or 'mpeg' or 'avi'){ how can i make that work? Thanks [/quote] Something like: if ($_FILES['userfile']['type'] == 'video/x-ms-wmv ' || $_FILES['userfile']['type'] == 'video/mpeg' || $_FILES['userfile']['type'] == 'video/x-msvideo'){ video/mpeg will handle MPG and MPEG. video/x-msvideo will handle AVI video/x-ms-wmv will handle WMV (not sure about this one) I'm not positive on the WMV one, but it may be right. You need to know the mime types associated with the files you are comparing against.
  2. Ok, I pretty much think I figured out what exactly is causing the problem. In short the script is suppose to let the user upload a JPG and the script then does some "modifying" on the image and regenerates it as a PNG (must be 8bit). Scenario 1: I uploaded a JPG image to the same directory as the script and just hard coded that images name into the script. When it generates the PNG everything is fine and dandy, I can save the image as PNG in IE and FF. Scenario 2: Use HTML form that allows the user to upload an image. The form calls the said PHP script and uses the file that they uploaded in the script, but can not save as a PNG in IE or FF. All morning I've been trying different things and it seems that as long as the PHP script is being referenced by a HTML form, it will NOT work. Can anyone think of a work around for this? I've tryed making the HTML form submit to a stand alone PHP script that would upload the file and store the name of the file in a session and then use HEADER to redirect to the actual generation script and then use the session variable of the file name, but that is a no go as well.
  3. [!--quoteo(post=365820:date=Apr 17 2006, 08:47 PM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Apr 17 2006, 08:47 PM) [snapback]365820[/snapback][/div][div class=\'quotemain\'][!--quotec--] I didn't realize this until today, but in php there is one superglobal in the whole language, that was a typo and people use it everyday and it is always mispelled, but they haven't changed it. HTTP_REFERER the actual true spelling is HTTP_REFERRER but you have to use it as referer, I read in hudzilla.com that it was a mispelling, very fascinating. [/quote] Realized that when I first saw it.....but now after using it so long I mispell referrer all the freaking time. If they changed it back to what it should be I'd get syntax errors for a week before I got use to spelling it right ;)
  4. [!--quoteo(post=365804:date=Apr 17 2006, 08:19 PM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Apr 17 2006, 08:19 PM) [snapback]365804[/snapback][/div][div class=\'quotemain\'][!--quotec--] have you tried imagejpeg or imagegif to see if ie and firefox just don't like PNG? Also, how is the file referenced? is it <img src="image.jpg"> or <img src="image.php?id=234"> or the like? You might have to cloak your php with something like .htaccess [/quote] I haven't tryed using the gif or jpg functions, because the script I wrote, relies on the outputed file to be PNG (8bit). I may mess with them tomorrow though out of curiosity, just to see if IE and FF throw fits with them as well. I already had a .htaccess file setup for the PNG script and I'm not calling the image via HTML at all. [a href=\"http://www.somewhere.com/image.png\" target=\"_blank\"]http://www.somewhere.com/image.png[/a] (which would execite...image.php as defined by the .htaccess file) When the script is run it does it's thing and generates the PNG image to the screen, that's it. No overhead at all on it.
  5. [!--quoteo(post=365788:date=Apr 17 2006, 07:48 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Apr 17 2006, 07:48 PM) [snapback]365788[/snapback][/div][div class=\'quotemain\'][!--quotec--] This should be OK... But where is the image resource ($im)? Also note that your script actually outputs an image, meaning that you shouldn't mix it with HTML or whatever, like. [/quote] Using a standard $im = imagecreatefrompng("whatever.png"); No HTML is used on the page that is displaying the generated image at the moment. The only thing displayed on the page is generated by imagepng()
  6. I have an issues when generating PNGs. The actual images come up just fine...no problem there, but if I right click on the generated image and try to save it, it only gives me the option of saving it as a .bmp in IE. In Firefox, it won't even allow me to download the image....well I can, but it won't be a valid image. Also, in IE when I right click on the generated images it says "Not Available" next to the File Type descriptor. Is this a common problem or something I may be doing? I basically want the users to be able to right click on the generated image and actually save it as a PNG image. I'm using: header('Content-type: image/png'); imagepng($im); imagedestroy($im); Thanks in advance guys!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.