[PHP] imagecreatefromjpeg problem

Khayman

I'm sorry Hal...
Political Access
Joined
6 Jan 2002
Messages
5,518
I've been playing with imagecreatefromjpeg and for the most part it works, but i moved the code to a new director and it doesn't

this directory stucure works with the code in photos and the pics in "me"
photos
+pics
++me
+++thumbs

but if I move the code to another directory, such as admin, then i get the error that the file does no exist.
photos
+pics
+-me
+--thumbs
+admin

it seems I cannot pass it a filepath which goes back up the tree and then down again such as "/pics/me/test.jpg"


That probably makes no sense to anyone. Its hard to explain, but its a simple problem. i hope someone knows a way around it
 
You can't use / to begin the file path, using:

+pics
+-me
+--thumbs
+admin

The file path from the admin directory would have to be

"../pics/me/test.jpg"
 
/ means the root of the filesystem.

You are trying to access /pics/me which would be in /, what you want is the location, down below from the current location, so ../ or ./../ would do the trick.

If Apache is not chrooted, / is where the Linux/unix file system begins. If this is on Windows, disregard my comments about what / is.
 
Its on Apache, but running on Windows (although it will finaly be running in Linux)

i have tried ../path and that works for most other functions but not for "imagecreatefromjpeg " function. Or I assume so as it actualy fails on "imageSX" which takes the result from "imagecreatefromjpeg" and then fails saying invalid resource
 
never mind, fixed it now it was somthing else kind of. i'm dumb :)
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back