this the URL https://147.16.202.30:8898/ftds/view/view_custom_search and 
the image will be expected to display on the same page

this the file location in controller

    file_location = os.path.join(request.folder, 'views','Plot')
    plot_list = os.listdir(file_location)

this is in the view:
{{for r in plot_list:}}
{{ if r.endswith('.html'):}}
<div class="plot_path" id ={{=plot_list.index(r)}}  style = 'width:100%; 
height:500px; display:none' >
{{=IFRAME(_src=r, _style = 'width:100%; height:100%; border: 0') }}
</div> 
{{else:}}
<div class="plot_path" id ={{=plot_list.index(r)}}  style = 'width:100%; 
height:500px; display:none' >
{{=IMG(_src=r, _style = 'width:100%; height:100%; border: 0') }}
</div>
{{pass}}
{{pass}}
</div>

the HTML file is displayed on the same page correctly but not the images 
(it's blank) even though they're both in the same folder.
Please help, Thanks

On Thursday, June 27, 2019 at 7:49:18 PM UTC-7, Dave S wrote:
>
>
>
> On Thursday, June 27, 2019 at 5:07:14 PM UTC-7, Quang Lam wrote:
>>
>> i have a trouble with displaying image stored in my local folder
>>
>> </div>
>> {{for r in plot_list:}}
>> {{ if r.endswith('.html'):}}
>> <div class="plot_path" id ={{=plot_list.index(r)}}  style = 'width:100%; 
>> height:500px; display:none' >
>> {{=IFRAME(_src=r, _style = 'width:100%; height:100%; border: 0') }}
>> </div> 
>> {{else:}}
>> <div class="plot_path" id ={{=plot_list.index(r)}}  style = 'width:100%; 
>> height:500px; display:none' >
>> {{=IMG(_src=r, _style = 'width:100%; height:100%; border: 0') }}
>> </div>
>> {{pass}}
>> {{pass}}
>> </div>
>>
>> i can display the HTML files in the same folder but not the png file and 
>> jpg file, please help 
>> Thanks
>>
>
> What folder are the files in?   If you use the browser developer tools, 
> what do you see being used for the URL that is being requested?
>
> /dps
>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a8835d50-3783-4865-b784-e481943e96e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to