NetTalk Central

Author Topic: Media display problem  (Read 3481 times)

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Media display problem
« on: November 26, 2013, 06:02:45 PM »
I incorporated a media display for PDF and JPG files a number of months ago. I basically copied what was in the Media (47) example. Everything was fine. However, I've now going back into that section of my app for more work and discovered that the files aren't displaying anymore. I went back to the Media (47) example, recompiled that, and I can't get anything to display there either.
I'm using C9 and NT7.30.

Mark

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Media display problem
« Reply #1 on: November 26, 2013, 06:04:02 PM »
Sorry, listed the wrong example #: it's 74 not 47.

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11264
    • View Profile
Re: Media display problem
« Reply #2 on: November 27, 2013, 06:54:48 AM »
Hi Mark,

I tested here with example "Media" and it also did not display the PDF.
But that's because the PDF's which should be part of the example are not included in the install. I coped them to the web folder, and after that it seemed to work fine.

so, first test - copy the attached PDF's to the example web folder, and try again...

cheers
Bruce


[attachment deleted by admin]

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Media display problem
« Reply #3 on: November 27, 2013, 09:26:22 AM »
I realized that the listed pdf's in the browse where not present and so had tried copying a sample pdf and jpg to both the app folder and to the \web\images folder but not to the \web folder. I do not see any code in the sample app designating that folder as the location for these files. Where in the embeditor would I set the path to the file I want to display?

FYI, when I tried to compile the example app (using C9 and NT730), it generates a compile error at line 53 of the PageFooterTag proc: Error: Cannot call procedure as function.

Here's the line =>   packet = clip(packet) & p_web.Script('startCountDown('& int(p_web.site.SessionExpiryAfterHS/100) &',"'& clip(p_web.site.LoginPage) &'","countdown");')

Mark

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Media display problem
« Reply #4 on: November 27, 2013, 12:12:59 PM »
I've now gotten both hyperlinks and jpgs to display properly. However when I try to display pdf's in my app, a prompt comes up for Adobe Acrobat Reader to display or save the file. When I display the exact same pdf file in the Media example app, it displays the pdf immediately. I've scoured the code to try and find any difference and I've been unsuccessful. Any ideas?

Thanks,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11264
    • View Profile
Re: Media display problem
« Reply #5 on: November 27, 2013, 07:23:19 PM »
Hi Mark,

>> ... the \web folder. I do not see any code in the sample app designating that folder as the location for these files.

All "static" files fetched by the browser are always "relative to the web folder". Thus in the absense of a path, the files should be in the web folder. If you want them to be in say the images folder, then the name in the link becomes '\images\' & whatever

>> Where in the embeditor would I set the path to the file I want to display?

you don't set it via embed code. The link itself should contain the full "web relative" path.

>> When I display the exact same pdf file in the Media example app, it displays the pdf immediately. I've scoured the code to try and find any difference and I've been unsuccessful. Any ideas?

usually folk ask it the other way around - where they want a file to be downloaded, not displayed. To do that you set the Content-Disposition header, so maybe you are setting that in your code somewhere?

Other than that I would need an example to make a more useful suggestion.

cheers
Bruce