Jump to content

Uploading problem


hadoob024

Recommended Posts

I've seen this issue posted a thousand times, but everyone else seems to have issues with the uploading part. My problem is with the displaying part. I read through the PHP manual about this, but it didn't answer my question.

When I process an uploaded file, do I have to move or copy it prior to displaying it? I'm not interested in saving the file right now. I just want to verify that it was uploaded properly by displaying it. Here's my code for displaying the uploaded image file.
Link to comment
Share on other sites

This is due to a security script that is installed and causes this in certian cases. It thinks your attacking server with your PHP code. for now could place your code over at [a href=\"http://pastebin.com/\" target=\"_blank\"]Paste Bin[/a] and provide a link to you code.

EDIT: I have edited your thread title as sadfasddf didn't make much sense!
Link to comment
Share on other sites

Cool. Thanks for the tip. I couldn't figure out why it wouldn't let me include my code. Anyway, the code for what I'm doing is located at:

[a href=\"http://pastebin.com/631485\" target=\"_blank\"]http://pastebin.com/631485[/a]

However, all this ends up displaying is garbage like the following:
"ÿØÿàJFIFddÿìDuckyPÿî&AdobedÀ MÍ„IÇü¢ÿÛ„      ÿÂÿÄ  0@P`1!"2#%345&p°$A!1Aq"Qa?‘2# 0@P¡ÑBRr‚’34`±ÁbC$Sƒ5ðáñcD%¢²s“Tdt°Â³Eu1!P`2 0@pA"Qa€?Àq‘±B ¡b1!AQaq@P?‘¡± 0`ÁÑðáñp°ÿÚ …üÿhðR˜ð?‡´û*Äý|>€†&ÙÑÓÞøîwÏmµ69®YÅĬa?Nœ˜¾¶Ö«¥*i¯Ól¦{o½~lÉ|´Zk söä3Üao–ã¿&÷lðµ¼e—NS.Œ]©{·,á¯4í|å‚ø!Â-63tŽ•PN\$BaCdpz.g;SM›¿3žþ€Äk‡õù’àȼ•k%ƒ|˜r^ÖNK¦°'/£‘¦€P˜Ÿ;|žÏµ©‘Ñ ç’{.ÀÅ€°8øêà&,×ÍHÕ!ªÅµZßU®š]tÖ©®G=²` #¯ÍïÍyÀ?Έ`HPêƒØq¹ÔFXbˆˆ‚sÚ÷'–à¯;ôn`›Î?Bçä?H>“ç*›¦€=ïÉúiÓÁzæÓ¤€š‡'îrß7x&ÍÕç÷nÜ»˜± £ÅŸŠæ¾]ź'ƒØ¨øo½Þ÷D{ôž{ÍâÊse†ìèõÝèÝÅ€f:8K:8ÀŠ¤[ôO®7_–ùÜ>óofO(Ù¹#tá¯;ý.²7™[{1Úί×3çÎçû7û ÐßT˾-6^ZÅÞµäo2°Öz½PñÕçþ†mÊüL5` êÛ¢¸}€6|?Íæ0ˆëÓ¼?æSXë´Oì^@ói¿ùÕ%Ï¿Iª§Ïç‘Î5¾©Òû*R§‘L^³c¢ÃIŽýmµ?Ù¾*®¢ÞÀ%N¿7¼5ç~-@J·èn\t7À|ÐŽý;är?+¾Ûÿ›]S²d.±?*mw¦Ó'‰ž‹èZSò(4OBÛן]'¾Ù¾xÊeç·¤•åÒ ú©û×L—ÂßL}µôÓ)[tæù÷Mêü"0 í5žø½P¹üÇÎÝæÄí:wlÌÞH ôk¿säL>Ç£Ôw°~RœúlÙï9qú`HŸ$?ú5?9ò|(JÚÓ3z¾‡WÞÀÌGæ1òú;®= HŸ$?z6?¹ñæT&m%e3?µ*-ktÒ_ÔYõûE½EýVõâ×”™ÓÙåëݪOÇÒ+ Å4Ÿ8½j€±ð|Ì&¤kzßcÊ>žÅýE‘QuµÅmy[_Rr›ÚÍÕf©ôør÷ø»«0yù6[€îg'§´ç¸Oñ¹‡Óà>Ÿ¢$¡î³ö¢kVvÏs‹¾=Np@G AS=¤œ;vÌ·™ðq«UjÍjÍÍfâ“sY¾Î×›šÍÅfµfµ^҇В÷ÓyÝ×ô|…é¤AÅë{Š3ÊÛÌQ˜ñåKð}À>À|•)‹kE?ãJ÷¸¿F¾—ÏøœâxÃ?ÔËÓP H·˜µšÛLQVœBh¯œÜæ*I¹ÍV“qš½&ë9¼Îo3¶G;^gkÊMÝ&â³}Xöä*íÖ‹+gxÇi[ ka¥m/ÚVÞÑozÛ^(^-oZ‹kÇ™„ª–{WõÏ»€“”by›Ðº¦–ÊÓˆ÷EÎsw’ã9¸Ên²\ç7™ÎGd³¶G+ßçkªMÅgÐÀ"o‚Þñmx¡zÚÞ(^-¯Z‹m ?²« ¥ÄMÅf´*@‚Ö¿¨>¯>ÔmKó:tß·7ϦkžùÒ}¬*Öné75µÝ&î–«€ õÞ8>åBbÞËi‰¿¿üÚ ÔâsŒMLÓr÷;GŸžû÷??>»Ç"


Any thoughts on what's going on? thanks!
Link to comment
Share on other sites

OK. So it's looking like I can't just take the uploaded image and display it. It seems like I have to move it to a temp directory and then I can display it. Anyway, I just modified my file upload script. Everything works fine until the following. I first specify a pathname to a directory that I created called "uploadtmp" which resides in my public HTML folder:

[code]$picpath = '/home/virtual/site109/fst/var/www/html/uploadtmp/'.$_FILES['picture']['name'];[/code]


I then move the file to this location using the following:

[code]if (!move_uploaded_file($_FILES['picture']['tmp_name'], $picpath))[/code]


However, this command gives me the following error message:

"Error Message:
move_uploaded_file(/home/virtual/site109/fst/var/www/html/uploadtmp/akira01.jpg):
failed to open stream: Permission denied
Error Code: 2"

What is causing this permissions error? Thanks.
Link to comment
Share on other sites

OK. I seemed to have gotten past the permissions error. I changed the permissions of that folder and now I'm not getting those errors anymore. I'm still getting jumbled up garbage when I try to display the image though. Here's the code:

[a href=\"http://pastebin.com/633809\" target=\"_blank\"]http://pastebin.com/633809[/a]

Any thoughts on why the image isn't being displayed?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.