Open Attachment action results in 404 error
October 18, 2016 12:00 AM
Hi all
I'm using Lectora Inspire v16.2.2.
I've attached 3 files to my project and added 3 buttons each with an Open Attachment action referencing the relevant file.
When I view the published html version in the local folder and click on the buttons, a new web window opens and I get a prompt asking if I want to open the file.
When I view the published version on the server I get a 404 error on clicking the button.
When I published the course as an offline module and click the buttons, the module disappears and nothing happens. I have found I can't use the offline option anyway because the video Full Screen button does not work, but I tried it to see if the attached files would open.
I've checked the published output folder, and the 3 files are sitting there. I can also see the files sitting in Lectora in the Attachments folder in the Resource Manager dialog.
Does anyone have advice on what I might need to do differently, or how best to attach files?
Thanks
amanda
Discussion (9)
This is the second time I've solved a problem after posting a question.. I usually try everything I can and then post a question when I feel really stuck, and now I've found a solution.
This time I zipped up all 3 files and attached the zip file to the button with the Open Attachment action. Works fine.
I didn't want to waste anyone's time, so no stress about this issue, unless you do know of something that I'm doing wrong that would make a difference.
Cheers
Amanda
This could be a lower case / upper case problem. Make sure the name of the attached file is all lower case and see if it helps.
This could me a MIMI file type setting with the server as well. What file type are you trying to open?
Okay, now I think @sirwise23 is correct. The server denies to serve unknown file types .vdcl (vector draw), .dm (datamine) and .dwg (autoCAD). The server has to be configured accordingly by the server admin, MIME types need to be set. Or zip them up and server won't care since ZIP is a familiar file type.
Thanks.
I tried changing the file name to all lower case, however this did not solve the problem. I have not heard of having to ensure the file name is all lower case, if this is necessary, it really needs to be included in the help files. Maybe it is, but I don't remember seeing it, as I referred to the help when I got stuck with this.
The files I'm trying to attach are .vdcl (vector draw), .dm (datamine) and .dwg (autoCAD).
I do think both the answers of @sirwise23 and Sergey's answer are correct. In your case probably mainly the server indeed doesnot recognize the mime-type and thus doesnot give access...but also when publishing Lectora has the nasty habit of changing uppercast to undercast and removing spaces. A file i got from a Mac-designer called 'Screen 01.mp3' attached properly and worked fine locally. Using HTML5audio to load the file i had to refer to the name. Local and in preview all worked. But after publishing and putting it on a LMS the file couldnt be found anymore. In the browser inspector tools i noticed the file missing was called screen_01.mp3... So Lectora changed the Mac name of the file into appropriate Windows/Unix names... removing the capital and the space...
Sergey,
I do hate the way Lectora changes those file names. You are pretty advanced in scripting and such though (Checking out BranchTrack when I have a some more free time). Yes, when calling files using and HTML widget then that file name change gets me every single time.
I think when just using the basic open attachment though, Lectora compensates for the file name change. Still this file name change is a real pain when it comes to trying to update a file after publish.
Those file types are not typical file types. I am assuming that everyone that has access to this project of yours also has AUTOCAD or something installed that can open and view that file extension? If the user doesn't have a way of opening the file the MIME type won't mater.
I don't know if this link will be of any help. It's something for the people that control your webservers to look into though.
http://www.codingstaff.com/learning-center/other/how-to-add-mime-types-to-your-server
Thanks for your responses, it is greatly appreciated.
For this issue, I found it easiest to zip the files and attach the zip file, as this is the quickest and best solution for me.
Regards
Amanda
I had this same error when trying to open an attachment via a link and was unable to resolve it now matter what I did. What did work for me is to open an attachment via a button. I don't really have time to investigate why but it does work and you can change the look of a button to appear as a link so it met my immediate purposes.
Discussions have been disabled for this post