displaying an image

Startbeitrag von Allard am 13.05.2013 18:30


I have a forum site. For the users I want to display an immage.

Ok So far on my development computer all goes well. However On the live site the immage is not displayed. I thought maybe the immagemap hasnot enough rights so I set that on 777. Still it doesnot work

Anybody any ideas what can be wrong. I use a linux webhosting account.




Hi Allard

when this happens, its most of the time that the path used is incorrect... It can be because of rights problems (you have them on development, but the internet user does not on the server) or because your dev machine is both server and client, which means that some path syntaxes working in dev mode wont on the server...

Without seing any details of your code, and in particular of the code used to display the image, and the path used, it's hard to be more specific

Best regards

von Fabrice Harari - am 13.05.2013 18:54
I made an edit control ( upload maskwith butto) to select a photo ( Avatar in the forum). Then I have a link witch runs the following code:

// the client site on click code
Error("Wel even een foto selecteren, Anders kan ik geen avatar voor je maken")

The server side code
// Creates the directory for large-size avatars
IF fDirectoryExist(fDirTempAvatars()) = False THEN

// Creates the directory for thumbnail avatars
IF fDirectoryExist(fDirAvatars()) = False THEN

// procedure is
PROCEDURE fDirTempAvatars()

RESULT fWebDir() + ["/"] + "../avatar"

sFileName is string
sUrlServerImage is string
sUrlWebImage is string
sFileName = "avatar-" + NumToString(ForumUser.ForumUserID, "06d") + fExtractPath(UploadFileName(EDT_AVATAR, False),fExtension)

// Copies the large-size avatar
UploadCopyFile(EDT_AVATAR, fDirTempAvatars(), sFileName)

// Update the image
IMG_AVATAR = "../avatar/" + sFileName

//saves the thumbnail
sUrlServerImage = fDirAvatars() + ["/"] + sFileName

// Move one level up because the avatars are not stored in the language directories
sUrlWebImage = "../images/avatar/" + sFileName
// Updates the image in the page
IMG_AVATAR = sUrlWebImage
// Updates the user
ForumUser.Avatar = sUrlWebImage

//Delete the large-size image
fDelete(fDirTempAvatars() + ["/"] + sFileName)

Hope you can help me out with my possible codig error. Because I have looked at it problebly to long. Ans as I stated it works on the development machine just fine.

Thanks for giving it a look


von Allard - am 13.05.2013 23:19

I'm confused... In your first post, you are saying that you have a problem with an image not being DISPLAYED...

But here you are giving us your code to UPLOAD the image...

So is the upload working or not?

Is the problem coming from the fact that the image is not uploaded correctly? Not saved correctly after resizing?

Is the image to be displayed really in the directory on the server?

Without those answsers, its really hard to tell, but one thing I would check is the sURLWebImage...
By coding it with "../", you are assuming that the relative positions of your page and your image are always the same, which is not true (the home page and each language pages are in different directories, so ../ is something that is language based... I would use an absolute URL instead at that level

Best regards

von Fabrice Harari - am 14.05.2013 12:44

The upload isnot working. The path to the immage is saved in de db just fine. I'll take a look at the relative path.


von Allard - am 15.05.2013 10:20

Thanks I solved the problem. Thanks for the help you pointed me in the right direction


von Allard - am 16.05.2013 13:44
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.