public static String getUploadTextFile(PFile file, Settings settings) {
      String desc = "";
      
      if(!settings.fileDescPath.isEmpty()) {
        BufferedReader in = null;
        try {
            in = new BufferedReader(new FileReader(settings.fileDescPath));
            String string;
            while ((string = in.readLine()) != null)
                desc += string + "\n";

        } catch (FileNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "Error: " + ex.toString());
            return null;
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "Error: " + ex.toString());
            return null;
        }
      } else return null;
      
      desc = desc.replace("%DESC%", file.getComponent(Elem.DESC));

      desc = settings.author.equals("own") ?
              desc.replace("%SOURCE%", "own work") :
              desc.replace("%SOURCE%", settings.source);

      desc = settings.author.equals("own") ?
              desc.replace("%AUTHOR%", "[[user:"+settings.username+"|]]") :
              desc.replace("%AUTHOR%", settings.author);

      desc = desc.replace("%USER%", settings.username);
      desc = desc.replace("%DATE%", file.getComponent(Elem.DATE));

      desc = desc.replace("%LICENSE%", settings.getLicenseString());

      desc = desc.replace("%CATEGORIES%", getUploadCategories(file.getComponent(Elem.CATS), settings.categories));

      desc = (!settings.extraText.isEmpty()) ?
              desc.replace("%EXTRA%", "") :
              desc.replace("%EXTRA%", settings.extraText);

      String[] c = file.getComponent(Elem.COOR).split(";");
      String out = "";
      if(c.length>1) out += "{{Location dec|" + c[0] + "|" + c[1] + "}}";
      desc = desc.replace("%COOR%", out);
        
      return desc;
    };