Jump to content


Photo

image hosting


  • Please log in to reply
39 replies to this topic

#21 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 07 June 2006 - 11:11 PM

thanks, I do have php 5 installed on the server, but i have to name the file filename.php5 in order for it to work!

im not getting the error message anymore, but i still cant upload!

#22 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 12:11 AM

where do i define how much space the user has?

#23 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 12:28 AM

Just add something to check it ... Like:

$size = (int) file_get_contents($dir . 'usage.txt');

if ($size => (10*1024*1024)) {
   die ("Wooops, size exceeded");
}

What happens when you try to upload? Did it work before?
Did you set the correct CHMOD for the folder(s)?
~ D Kuang

#24 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 02:37 AM

no the upload part of it has never worked.

who i added the code you gave me it gave me a blank screen. im not sure where i should add it. and then how would i use the else part of that if statment?

cmod settings are fine also.

from what i have posted can you tell me where the images would be uploaded to,
htdocs/www/special/tutorials/uploads/username

thats what it should be.

then you can get to that by going to
www.site.com/special/tutorials/uploads/username/image.jpg

edit: i echo'ed the dir variable
and it read
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]uploads//[/quote]
it ignoring the
$session->username

#25 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 02:58 AM

ok i have edited the code to replace $sesson->username.
now i still cant upload but something did change

Folder size: 37546 bytes

it used to say zero
Usage: still says zero though.



#26 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 03:58 AM

[!--quoteo(post=381259:date=Jun 7 2006, 07:58 PM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 7 2006, 07:58 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
ok i have edited the code to replace $sesson->username.
now i still cant upload but something did change

Folder size: 37546 bytes

it used to say zero
Usage: still says zero though.
[/quote]
CHMOD usage.txt to at least 666.
~ D Kuang

#27 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 02:17 PM

edit: sorry I cant post the code i need to show you for some reason! im getitng a forbiden message!

#28 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 02:21 PM

[!--quoteo(post=381400:date=Jun 8 2006, 07:17 AM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 8 2006, 07:17 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
edit: 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?
~ D Kuang

#29 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 02:49 PM

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?

#30 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 02:53 PM

[!--quoteo(post=381418:date=Jun 8 2006, 07:49 AM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 8 2006, 07:49 AM) View Post[/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.
~ D Kuang

#31 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 03:07 PM



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!

#32 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 03:12 PM

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

~ D Kuang

#33 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 03:32 PM

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?

#34 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 07:40 PM

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.


edit: 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

#35 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 08 June 2006 - 08:14 PM

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.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#36 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 09:26 PM

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???


#37 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 10:11 PM

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!
$pext = getFileExtension($imgfile_name);

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]

#38 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 10:28 PM

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.
~ D Kuang

#39 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 June 2006 - 10:34 PM

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!!! :)

#40 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 09 June 2006 - 07:30 AM

[!--quoteo(post=381625:date=Jun 9 2006, 06:34 AM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Jun 9 2006, 06:34 AM) View Post[/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
[url=http://darkswordsguide.com][/url]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users