For every filenode, when I click on the download link, the file that I am prompted to download is named "file". Is there any way to base this download name on the nodes title or something else?
For every filenode, when I click on the download link, the file that I am prompted to download is named "file". Is there any way to base this download name on the nodes title or something else?
Comments
Comment #1
rmh3093 commentedthis seems to only be the case if I create the file node with php using a pre existing bitcache, when I create a filenode manually the download name makes sense, am i missing a filed when creating this node
Comment #2
rmh3093 commentedit seems like when i use the xmlrpc service to upload the bitstream, the mimetype gets set to application/octet-stream when it should be application/x-lzma... idk why this is getting screwed up
Comment #3
rmh3093 commentedthis seems to be fixed now... maybe it was cause i enabled server side mime detection
Comment #4
rmh3093 commentednow some of the links end in .bin and others are correct, wtf is going on here
Comment #5
miglius commentedMost probably the problem is that the MIME type is not detected properly. Fileframework allows trusting the MIME type provided by the browser (some browsers does not post the uploaded file's MIME), detection the MIME on the server side (using fileinfo), which is not ideal as also does not work for all cases, or conditional - try to detect on the server side if the browser does not send the MIME.
Comment #6
rmh3093 commentedwell none of my files nodes that I create programatically display the correct mime type which should be "LZMA Archive". if I upload the file though the browser the mime type is correct, is there a way I can force the mime type or am i doing something wrong with xmlrpc which is causing the information to get lost
Comment #7
miglius commentedWhen you saved the file in bitcache and are creating a node, the fileframwork trust the MIME type which is pulled from the bitcache:
This is a bitcache function which tries to detect a MIME type:
try running "file -bi your_file" on the command line to see if this utility can detect LZMA type.
Comment #8
rmh3093 commentedwell this would explain things, file -bi something.lzma returns application/octet-stream I had to write a patch to the file program which provided a magic code for lzma archives ;) thanks for your help... my server is down atm so I cant confirm that my new binary will help but I think it will
I will report back asap
Comment #9
miglius commentedComment #10
johanneshahn commentedfeel free to reopen issue