Taxel Taxel - 1 year ago 83
React JSX Question

Meteor FS link leads to 404 Error

I am currently developing a Meteor React app, which is using the ostrio:files package to store audio files in a collection named Files. In another (regular mongo) collection, I am using the following code in the transform function to "join" the document with the link to the audio file:

transform: function(doc){
let curAudio =;
let audioFile = Files.collection.findOne({_id: curAudio.file_id});
curAudio.audioLink =;
curAudio.audioLength = audioFile.meta.length;
curAudio.audioSize = audioFile.size; = curAudio;
return doc;

This seems to work just fine, as the resulting audio.audioLink is something like


But when I try to do something like this

<audio controls preload="none" style={{width: "480px"}}>
<source src={track.audioLink} type="audio/mp4"/>
<p>Your browser does not support HTML5 audio.</p>

To be able to play the file, everything works until I click the play button of the HTML5 player. Then, chrome outputs to the console, that the server returned 404 when the file was supposed to be loaded. I tested putting the link into the adress bar, here the server response is just

File Not Found :(

Does anyone have an idea how to fix this?

Answer Source

I found the answer: My local Ubuntu installation was apparently configured to store uploaded files in /tmp, which didn't caus problems until I restarted the system or cleared my temporary files otherwise. Having the server recreate the DB fixed the problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download