poirot Posted June 8, 2006 Share Posted June 8, 2006 [!--quoteo(post=381259:date=Jun 7 2006, 07:58 PM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 7 2006, 07:58 PM) [snapback]381259[/snapback][/div][div class=\'quotemain\'][!--quotec--]ok i have edited the code to replace $sesson->username. now i still cant upload but something did changeFolder size: 37546 bytesit used to say zero Usage: still says zero though.[/quote]CHMOD usage.txt to at least 666. Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43064 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 [b]edit:[/b] sorry I cant post the code i need to show you for some reason! im getitng a forbiden message! Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43192 Share on other sites More sharing options...
poirot Posted June 8, 2006 Share Posted June 8, 2006 [!--quoteo(post=381400:date=Jun 8 2006, 07:17 AM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 8 2006, 07:17 AM) [snapback]381400[/snapback][/div][div class=\'quotemain\'][!--quotec--][b]edit:[/b] sorry I cant post the code i need to show you for some reason! im getitng a forbiden message![/quote]Probaly the over sensitive security system is blocking your POST data.Did you try to post f.open, f.write, f.close or something like this? Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43196 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 no i was trying to post the upload script that I had that was working without the restrictions.would you mind if i PMed it to you? Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43210 Share on other sites More sharing options...
poirot Posted June 8, 2006 Share Posted June 8, 2006 [!--quoteo(post=381418:date=Jun 8 2006, 07:49 AM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 8 2006, 07:49 AM) [snapback]381418[/snapback][/div][div class=\'quotemain\'][!--quotec--]no i was trying to post the upload script that I had that was working without the restrictions.would you mind if i PMed it to you?[/quote]Not at all [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]But I don't think it's going to work anyway. Try to host the code somewhere and post the link. Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43212 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 try this. let me know when you have it becuase i dont know if im supose to use this for my own personal use ;)its the txt file so you can view the code, otherwise it might be a little difficult for you if i had the php file! Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43222 Share on other sites More sharing options...
poirot Posted June 8, 2006 Share Posted June 8, 2006 I got it. OK, I check your code. There are some functions and variables that I don't know how they were set or what they are. They must come from an included file, but whatever.It also appears that you are not using move_uploaded_file to move the uploads. Try to use it, because it's easier IMO. Also, first things first. Try to use the code I posted and change "$session->username" to "test" and create a directory named "test" with a file "usage.txt" chmoded 666.Then you can see if that works. Also, I don't know what is your problem right now... Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43224 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 still nothing.i figured out why the session->usernam doesnt work. so I replaced the scandir function with the custom one. but its still not uploading right.can you tell me how to apply the restrictins you have coded to the upload script I showed up via the txt file? Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43229 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 ok i tried to merge the code and im not having much luck!maybe you can find something, when i try to uplaod a file it says,[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Current usage: 0 bytes. Error Uploading File[/quote][a href=\"http://www.trekcore.com/staff/me1000/upload.txt\" target=\"_blank\"]link to code[/a]there is the link to the code im using.ill continue to work on it.[b]edit:[/b] ok i figured out why it wasnt uploading. it was because it was going to the wrong folder.the upload part works, but its not writing the correct value in the file usage.txt it is writing 0 all the time Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43352 Share on other sites More sharing options...
Buyocat Posted June 8, 2006 Share Posted June 8, 2006 me100, why don't you try using a PEAR package for this? No need to beat your head against this problem and that way you can focus on getting the sessions to work and just implement the package after they pass. I use this package for my file uploads, I can try to answer questions if you have 'em.[a href=\"http://pear.php.net/package/HTTP_Upload\" target=\"_blank\"]http://pear.php.net/package/HTTP_Upload[/a]I also think that it is more secure to use a package that has been touched by many hands than to try to make something like this on your own, unless you are very experienced with HTTP and security issues. Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43362 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 Thanks for the link but I would like to do this myslef, without having to use some one else's script.the session works fine. here is the link to it now.[a href=\"http://www.trekcore.com/staff/me1000/upload.txt\" target=\"_blank\"]link to code[/a]can you please tell me why it is not adding up the file size's and writing them to the usage.txt file??? Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43397 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 first off, I would like to thank everyone that has helped me here.everything works like a charm now!except for some reason the following line no longer works![code]$pext = getFileExtension($imgfile_name);[/code]can you tell me why?this is the error im getting,[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Fatal error: Call to undefined function: getfileextension() in /htdocs/www/special/tutorials/uploads/upload.php on line 91[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43410 Share on other sites More sharing options...
poirot Posted June 8, 2006 Share Posted June 8, 2006 You must define the function before you call it. And you need to change the part of the code that adds the usage. It's no longer the uploaded file that you are storing, but the new, resized file. Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43414 Share on other sites More sharing options...
me1000 Posted June 8, 2006 Author Share Posted June 8, 2006 ok i moved where it defines the function, IDK why it didnt work, i havent moved any of that particular code around at all!andyway it works now.thank you for all your help!!! :) Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43415 Share on other sites More sharing options...
php_joe Posted June 9, 2006 Share Posted June 9, 2006 [!--quoteo(post=381625:date=Jun 9 2006, 06:34 AM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 9 2006, 06:34 AM) [snapback]381625[/snapback][/div][div class=\'quotemain\'][!--quotec--]ok i moved where it defines the function, IDK why it didnt work, i havent moved any of that particular code around at all!andyway it works now.thank you for all your help!!! :)[/quote]Hi,I am working on something simular and I would like to have the image broken up into several small pieces (say 9 equal sized pieces, like a tic-tac-toe board) and renamed something like image1-1.jpg, image1-2.jpg, etc...Is there a simple way of doing this, or do I need to use imagecopy 9 times?Thanks!Joe Quote Link to comment https://forums.phpfreaks.com/topic/11440-image-hosting/page/2/#findComment-43555 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.