File Uploads

Help
M Knoper
2009-02-11
2013-05-28
  • M Knoper

    M Knoper - 2009-02-11

    I would like to know which files, if any, refbase is restricted to uploading. Is it only PDF? Or can any type of file be uploaded?

     
    • Matthias Steffens

      > I would like to know which files, if any, refbase is restricted to
      > uploading. Is it only PDF? Or can any type of file be uploaded?

      You can upload any file. However, file names must not end with .exe, .com, .bat, .zip, .php, .phps, .php3 or .cgi.

      In the refbase interface, non-PDF files will be indicated with a generic file icon, as can be seen in this screenshot (taken from an older refbase version):

      http://features.refbase.org/img/ListView.jpg

      HTH, Matthias

       
    • M Knoper

      M Knoper - 2009-02-11

      Yes, it answers my question, thanks. (I asked because of security concerns.)

      One final question - in which refbase file is coded the types of files that can be uploaded?

       
    • Matthias Steffens

      > in which refbase file is coded the
      > types of files that can be uploaded?

      ATM, the list of forbidden file name extensions is hardcoded into 'modify.php' (at line 588, in case of refbase-0.9.5). You could also search that file for ".exe".

      To only allow for upload of files with a .pdf file name extension, replace line 588 with this one:

      if (!eregi("\.(pdf)$", $uploadFile["name"]))

      Matthias

       
    • M Knoper

      M Knoper - 2009-02-14

      Yep. You read my mind. That's exactly what I wanted to do - restrict uploads to .pdf files only. Thanks!

       
    • Matthias Steffens

      > That's exactly what I wanted to do -
      > restrict uploads to .pdf files only.

      Glad I could be of help! Let us know if you've got further questions.

      Matthias

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks