Jump to content

Archived

This topic is now archived and is closed to further replies.

me1000

image hosting

Recommended Posts

[!--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 change

Folder size: 37546 bytes

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

Share this post


Link to post
Share on other sites
[b]edit:[/b] sorry I cant post the code i need to show you for some reason! im getitng a forbiden message!

Share this post


Link to post
Share on other sites
[!--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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites


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!

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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???

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!!! :)

Share this post


Link to post
Share on other sites
[!--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

Share this post


Link to post
Share on other sites

×

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.