• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[PHP] imagecreatefromjpeg problem

Khayman

I'm sorry Hal...
Political User
#1
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
 

j79zlr

Glaanies script monkey
Political User
#2
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"
 

X-Istence

*
Political User
#3
/ 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.
 

Khayman

I'm sorry Hal...
Political User
#4
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
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,014
Latest member
sanoravies