diff --git a/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/document_upload.pl b/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/document_upload.pl index 4944104..eec525a 100755 --- a/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/document_upload.pl +++ b/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/document_upload.pl @@ -14,7 +14,7 @@ $c->{required_formats} = [ # "text/html", -# "application/pdf", +# "application/pdf", # "application/postscript", # "text/plain", ]; @@ -82,6 +82,33 @@ return "video/mpeg" if $suffix eq "mpeg"; return "video/quicktime" if $suffix eq "mov"; return "video/x-msvideo" if $suffix eq "avi"; + + ## NJS 2008-07-17: Added various missing document types. + + # MS Excel is inexplicably missing above. + return "application/application/vnd.ms-excel" if $suffix eq "xls"; + + # May as well map CSV to Excel too. + return "application/application/vnd.ms-excel" if $suffix eq "csv"; + + # Office XML document types. + return "application/application/vnd.ms-excel" if $suffix eq "xlsx"; + return "application/vnd.ms-powerpoint" if $suffix eq "pptx"; + return "application/msword" if $suffix eq "docx"; + + # LaTeX + return "application/x-latex" if $suffix eq "tex"; + + # Audio + return "audio/mpeg" if $suffix eq "mp3"; + return "audio/x-wav" if $suffix eq "wav"; + + # Compressed archives + return "application/zip" if $suffix eq "zip"; + return "application/x-gzip" if $suffix eq "gz"; + return "application/x-gzip" if $suffix eq "tgz"; + + ## NJS end } return "other";