Re: [Cppcms-users] undefined reference to `cppcms::widgets::file::filename(booster::regex const&)'
Brought to you by:
artyom-beilis
From: <cn...@gr...> - 2010-09-13 09:48:17
|
Hi! Artyom, > BTW, there are some better tests for checking file type: mime() type and add_valid_magic() where the last is the best one. Thank you for the enlightenment! According to http://www.garykessler.net/library/file_sigs.html , the jpeg magic number is "FF D8 FF E0 xx xx 4A 46 49 46 00" and the png one is "89 50 4E 47 0D 0A 1A 0A". Member function void cppcms::widgets::file::add_valid_magic(std::string const &) expects std::string as the argument. If I accept both jpeg and png files, what std::string should I pass to add_valid_magic? This raises another question: It is server's responsibility rather than browsers to perform the validation triggered by add_valid_magic, isn't it? If it is, will cppcms automatically do the validation? If it is programmer's job, a snippet of validation example code will be much appreciated. Thank you in advance! Regards, CN |