The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
File upload filename - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: File upload filename (/showthread.php?tid=1606)



File upload filename - mrdan - Sep 8th, 2011

I have a multi-page form where one of the fields is for an image upload. It works fine except the filename is file.jpg, 1_file.jpg, 2_file.jpg, etc. Can it be set up so the filename is actually the name of the file being uploaded, preceded by 1_, 2_, etc, for duplicate names instead of formtools forcing the filename to be "file", or am I doing something wrong causing the filename to be lost?


RE: File upload filename - Ben - Sep 8th, 2011

Hi mrdan,

Welcome to the forums!

Couple of questions: what version of the Core are you using? And what was the original filename of the file being uploaded?

- Ben


RE: File upload filename - mrdan - Sep 8th, 2011

Hi Ben,

v 2.0.6

original filename = winterpainting.jpg .

Thanks for your help.


RE: File upload filename - Ben - Sep 10th, 2011

Hi mrdan,

Would you mind trying this? Add this line to your /global/config.php file:

PHP Code:
$g_filename_char_whitelist "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"

For some reason, the code can't find that variable in the file upload code, so it doesn't think that ANY character is valid - which is why it defaults to the "file" filename fallback.

This would imply that when you upgraded at one point, all the files weren't uploaded to the site... but let's see if this fixes it and we'll go from there!

- Ben


RE: File upload filename - mrdan - Sep 10th, 2011

That did the trick!!

Thanks so much for your excellent support!


RE: File upload filename - Ben - Sep 14th, 2011

Interesting....! I'm very glad it worked, but would you mind taking a look at your /global/library.php file? It sounds like maybe that file wasn't upgraded properly. At the top of the file, what version does it say Form Tools is?

That file *should* contain that variable you just added to your config.php file.

- Ben


RE: File upload filename - Kfrix - Sep 23rd, 2011

I have exactly the same problem! I'm adding that line to my config file now. I looked at my library.php file, and the version is @version 2.0.6 * @package 2-0-6

In library.php the line is there, but has a slight difference, a dash after the underscore before the numbers
My Formtools is version 2.0.6

Thanks for this fix, I have applied it, and it worked.

Kathryn