Add File ID to the List

Permalink Browser Info Environment
I'd like the list to display the file ID. How would I do that?

Type: Discussion
Status: Resolved
kreative
View Replies:
mesuva replied on at Permalink Reply
mesuva
This should be pretty easy to achieve by creating a custom block template and using in the main loop:

$fileID = $f->getFileID( );

Then just outputting where you need it:
<?php echo $fileID; ?>

I am curious as to why you would want to do this though, as the file ID is very much just for internal linking purposes and doesn't have much value for someone to actually read on screen.
kreative replied on at Permalink Reply
kreative
Thanks for the speedy reply. I did what you recommended and it worked great.

The reason I am doing this is because we use a form to allow users to upload application files. Our Admissions office is notified whenever a form is submitted and in that email, they'll see something like:

Upload your Form
3283

The actual attachment isn't included in the email

I used your add-on to give them a web page they can go to to actually download the attachment. By adding the ID to the list, it allows them to more easily match the email with the file they need to download. So, on the web page they'll see.

LOI.docx - 9/8/2015 - 3284
resume.sci.doc - 9/8/2015 - 3283
Resume.docx - 9/8/2015 - 3276
FNP resume 2015.docx - 9/8/2015 - 3275
USJ Essay -In Five Years.docx - 9/8/2015 - 3274

Without the ID, and with numerous files coming in, it made finding the correct file a little cumbersome.
mesuva replied on at Permalink Reply
mesuva
Ahh right, that makes a lot of sense!

Thanks for satisfying my curiosity!

concrete5 Environment Information

# concrete5 Version
5.6.3.3

# concrete5 Packages
Advanced Forms (1.11.5), FlexJob Scheduler (1.0.4), FlexSlider (2.1.2), List files from set (1.0.4), OWL Carousel (2.3.0), Page Redirect (1.4), Page Selector Attribute (1.1), PUG+ PopUp Gallery (1.7.1), Scholarship Grid (1.2.0), Stack Selector Attribute (1.1), Studio Testimonials Pro (1.0.0), USJ Web Toolkit (0.9.8).

# concrete5 Overrides
blocks/link_list, blocks/rss_displayer, blocks/survey, blocks/page_list, blocks/form, blocks/search, blocks/sixeightforms, blocks/content, controllers/dashboard, elements/header_required.php, helpers/USJAlert.php, helpers/USJNav.php, helpers/USJNews.php, jobs/process_advanced_forms.php, mail/block_guestbook_notification.php, mail/user_register_approval_required.php, mail/block_form_submission original.php, mail/forgot_password.php, mail/block_form_submission.php, mail/private_message_response_enabled.php, mail/mail_importer_error.php, mail/private_message.php, mail/user_registered_approval_complete.php, mail/basic_workflow_notification.php, mail/spam_detected.php, mail/validate_user_email.php, mail/user_register.php, mail/private_message_admin_warning.php, single_pages/dashboard, single_pages/login.php, themes/usj

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.3.5

# PHP Extensions
bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, ionCube Loader, json, ldap, libxml, mbstring, mcrypt, mysql, mysqli, odbc, openssl, pcntl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, readline, Reflection, session, shmop, SimpleXML, snmp, sockets, SPL, standard, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 60
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
memory_limit - 128M
post_max_size - 8M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 128M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.