Upload Files (PDF)

Hi all ,
Is there any way to upload pdf’s to thunkable .
I checked a few tutorials but couldnt understand what will be the upload preset though.
If not , if and when that component would be introduced would be very helpful.

a text input which sets a pdf viewer' 's file

I cant understand what you meant . What i asked for was to be able to upload a pdf from the users side

1 Like

so far in my knowledge you only can upload picture only. for file you need to think other way like java scrip or other external solution. it is frustration for me also.

1 Like

The PDF Reader accepts a URL so you can use this as an option.

1 Like

Yes @muneer but what i want is for a user to be able to upload a pdf and i be able to show that.
Even Anything javascript would work

1 Like

Check this

See the following post

1 Like

Yes @muneer i checked that post and by that i was able to get the name of the pdf file. But what i want is to get the contents or something which i can show in the pdf viewer while viewing

1 Like

If you are allowing the user to browse a certain server folder and select a name then all what you need to do is to make the full URL from the server path that you already know and the selected file and this URL should be the URL of the PDF Reader component of Thunkable.

1 Like

But I am not doing this. He/she can browse anywhere

1 Like

You will have to deal with a security issue. All new browsers restricts the path of the file to reduce the risk of malicious acts.

You will need an additional library to read the actual path. File path is restricted in HTML and JavaScript and you need to add a library for that.

muneer,

so basically any file can upload to cloud storage? cloudinary for example?

1 Like

Media DB can only upload image files but the Cloudinary API can upload any file.

1 Like

you can try this:

MediaManager.get().upload(file).dispatch();

  • file(string)

  • upload present(public id,folder,context,face coordinate,custom coordinates)

  • signature(rest api calls)

  1. use file nameto true( usepublic id)

  2. folder(contains data of the public id)

  3. use file name(file name for public id)

1.resourse type(type like video ,image , auto , raw)
used more : visit docs

How to get the file string @super-coder

So @muneer is there any of just transferring the file content?
or is there no way of doing so unless thunkable makes this component?

from the public id

@super-coder i still cant understand.
@muneer i tried the cloudinary api and was able to upload my files, but how to get the url of that uploaded was not clear to me

1 Like

what I was saying is docs of the cloudinary api

The API returns a JSON string which has the destination URL.