# How to return File type data in element in Bubble plugin?

While making the "File-uploader" or any file-related plugin, you realize it's better to use the "File" data type instead of showing the "file-url" as text. Using the "File" data type instead of "file-url" has many advantages. For example, you can put the "File-name" and "File-url" in the same variable instead of making two separate variables. You can also directly save the "File" type data into Bubble DB.

But the real question is how to do it -

Follow these steps-

**Step 1:**

Create the variable type "File" as the exposed state-

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696912324463/97824cb4-d9e8-4529-817f-a38a5c5b1824.png align="center")

**Step 2:**

Create a variable to hold the file URL (remember to add the "https" prefix if it's not already included) and then expose the variable.

```javascript
var file_url = "https"+url_without_http; 
instance.publishState("uploaded_file",file_url);
```

It will automatically expose the file-name too.

---

That's all for this blog. Subscribe for more future updates. Thank you!

Follow me on [twitter](https://twitter.com/NocodeTalks).

**Checkout My Bubble Plugin Course** - Use coupon code "THEBUBBLEGROUP" at checkout for 10% discount.

%[https://nocodetalks.co/bubbleplugin]
