On Friday, June 28, 2019 at 7:20:21 AM UTC-7, Quang Lam wrote:
>
> this the URL https://xxx.xx.xxx.xx:8898/ftds/view/view_custom_search
> <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
>
I'm specifically interested in what the browser thinks the URLs are; you
seem to be using relative URLs in your code, and perhaps the IFRAME()
helper and the IMG() helper compute that differently. Although I would
expect you to need 'Plot' in the URLs for both.
Are you using routes.py at all?
/dps
> 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/85819a1a-a5c6-4a97-8367-e323f9e5f1cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.