- Posts: 55
- Thank you received: 4
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to extract the information of an uploaded file?
- Usapuka
- Topic Author
- Offline
- Senior Member
Less
More
8 years 9 months ago #122429
by Usapuka
How to extract the information of an uploaded file? was created by Usapuka
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
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
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
8 years 9 months ago #122453
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on 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:
And this for the file-extension:
Try this for the file-name:
Code:
{stristr(str_replace('filename":"', '', stristr(upload1, 'filename":"')), '"', 'true')}
And this for the file-extension:
Code:
{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
The topic has been locked.
- Usapuka
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 4
8 years 9 months ago #122471
by Usapuka
Replied by Usapuka on topic How to extract the information of an uploaded file?
Hi tpartner,
Thank you!
Best regards,
Thank you!
Best regards,
The topic has been locked.
- xamarshahx
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
5 years 10 months ago #169179
by xamarshahx
Replied by xamarshahx on topic How to extract the information of an uploaded file?
Did you ever find a way with EM?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
5 years 10 months ago #169187
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on 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.
The topic has been locked.
- xamarshahx
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
5 years 10 months ago #169337
by xamarshahx
Replied by xamarshahx on topic How to extract the information of an uploaded file?
Was anyone able to find a way to use EM to extract the info?
The topic has been locked.
- xamarshahx
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
5 years 10 months ago #169338
by xamarshahx
Replied by xamarshahx on topic How to extract the information of an uploaded file?
Thanks
The topic has been locked.
- vanessa74
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
4 years 9 months ago #186300
by vanessa74
Replied by vanessa74 on topic How to extract the information of an uploaded file?
Hi,
The code works but only for one file. How can I extract the informations if more than one file is upploaded ?
Thanks
Van
The code works but only for one file. How can I extract the informations if more than one file is upploaded ?
Thanks
Van
The topic has been locked.