How to extract the information of an uploaded file?

More
3 years 2 months ago #122429 by Usapuka
Usapuka created the topic: How to extract the information of an uploaded file?
Hi,
When a file is uploaded (using the Question type - File upload) the following information is generated:
[{"Title": "Card", "comment": "Mercedes Benz", "size": "36 486", "name": "Imagen000.jpg", "filename", "fu_aa5i9pw7mdgbkvh", "ext": "jpg "}]
How can I extract (using EM) the different parts of the information? For example I would like to get the "name" and "filename".
Thanks! greetings

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #122453 by tpartner
tpartner replied the topic: How to extract the information of an uploaded file?
Assuming a question code of "upload1" and that you only allow one file to be uploaded...

Try this for the file-name:
{stristr(str_replace('filename":"', '', stristr(upload1, 'filename":"')), '"', 'true')}

And this for the file-extension:
{stristr(str_replace('ext":"', '', stristr(upload1, 'ext":"')), '"', 'true')}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Usapuka

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #122471 by Usapuka
Usapuka replied the topic: How to extract the information of an uploaded file?
Hi tpartner,

Thank you!

Best regards,

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #169179 by xamarshahx
xamarshahx replied the topic: How to extract the information of an uploaded file?
Did you ever find a way with EM?

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #169187 by tpartner
tpartner replied the topic: How to extract the information of an uploaded file?
The given answer was EM (Expression Manager).

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #169337 by xamarshahx
xamarshahx replied the topic: How to extract the information of an uploaded file?
Was anyone able to find a way to use EM to extract the info?

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #169338 by xamarshahx
xamarshahx replied the topic: How to extract the information of an uploaded file?
Thanks

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!