Showing images in label

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Showing images in label

Postby ahmad » Sun Mar 21, 2004 8:54 am

I have a label on my form which shows the following html
Code: Select all
<img src="file:///%%file_name%%">


where file_name stores the image filename with full local path (the backslashes were replaced with forward slashes)

Afte I type in the above html and come back to Browse view, the error says "cannot set up form"

But the same thing works if store the full path with the word file:/// it works

Code: Select all
eg: file_name_c = "file:///" + file_name (c:/my_images/a.jpg)

I then displays this field in the html text label as <img src="%%file_name_c%%">


Thanks
Ahmad
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong

Postby jcompagner » Sun Mar 21, 2004 1:51 pm

i have reproduced the problem. i am looking at it.

But one question. Why are you doing this? Storing a hard path? Because how do you get the images to the clients?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8852
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby ahmad » Sun Mar 21, 2004 7:05 pm

I'm having a function to bulk import images into the gallery file.

To ease the process when the user clicks the "Batch Import" button it opens up with the folder dialog.

I have a temporary table called "batch_import"

After the user chooses the folder the script loops all files in the chosen folder and creates records in the "bacth_import" table (one record for each file in the folder)

I store the chosen folder path in a global field called g_Selected_Folder
(eg: C:\Documents and Settings\Administrator\My Documents\My Pictures)

I store the filenames in the field called img_file_name (eg: image1.jpg)

Now I want to display the images in the label with the calulation

Code: Select all
<img src="file:///%%g_Selected_Folder%%/%%img_file_name%%">


The user will scroll through the records and choose the ones he wants to import (be default all records will be tagged)

After he clicks confirm the records will be created in gallery with the images stored in media field

Hope this makes sense

If this is complicated no need to worry because I have another way of displaying too

Thanks
Ahmad
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong

Postby jcompagner » Mon Mar 22, 2004 3:15 pm

you will not get an error anymore. (2.0RC10)
But if the image can't be found with that syntax you will get that default broken image...
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8852
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby ahmad » Mon Mar 22, 2004 3:54 pm

Thanks Johan,

That's great
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 11 guests