This topic was automatically generated from Slack. You can find the original thread here.
I don’t believe Pi is updated to answer questions about the newly released file store. But i’m encountering a problem trying to use it. The code examples provided by you guys seem to not be working. Even the very simple snippet
I’m here to help! Could you please provide more details or describe the issue you’re facing with Pipedream? This will help me understand your situation better and provide you with the most accurate assistance.
I don’t believe Pi is updated to answer questions about the newly released file store. But i’m encountering a problem trying to use it. The code examples provided by you guys seem to not be working. Even the very simple snippet
I’m sorry to hear you’re having trouble with the file store feature. Let’s try to troubleshoot this together. The code snippet you’ve provided looks like it’s attempting to open a file from a URL and then log the file’s URL. However, if file.url is undefined, it suggests that the file object may not have the expected properties. Could you please confirm if you’re receiving any errors in the logs apart from the undefined file.url? Additionally, are you able to verify if the file is being created in the file store by checking the Pipedream UI? In the meantime, here’s a slightly modified version of your code snippet that includes error handling to help us diagnose the issue: ```
import { axios } from “@pipedream/platform”; export default defineComponent({ async run({ steps, $ }) { try { const file = await $.files.open(‘pipedream.png’).fromUrl(‘https://res.cloudinary.com/pipedreamin/image/upload/t_logo48x48/v1597038956/docs/HzP2Yhq8_400x400_1_sqhs70.jpg’); console.log(file.url); } catch (error) { console.error(Error opening file: ${error}); } }, });
It seems like you’re encountering an issue where you’re expecting to see a file in your Pipedream UI, but it’s appearing as ‘undefined’, and no errors are being caught. To assist you better, I’ll need some more information: 1. Could you provide the code snippet that you’re using to save or access the file? 2. Are you using a specific Pipedream built-in service (like the /tmp directory or data stores) to store your file? 3. When you mention “file store,” are you referring to a data store or are you trying to write a file to the filesystem within a workflow? Once I have this information, I’ll be able to provide you with more targeted assistance. If you’re looking for immediate help, you can also visit Pipedream Support for more support options.
Hi , in the doc here, I see that you will need to use the code like this:
export default defineComponent({
async run({ steps, $ }) {
// Upload a file to the File Store by a URL
const file = await $.files.open('pipedream.png').fromUrl('https://res.cloudinary.com/pipedreamin/image/upload/t_logo48x48/v1597038956/docs/HzP2Yhq8_400x400_1_sqhs70.jpg')
// display the uploaded file's URL from the File Store:
console.log(await file.toURL())
},
})
thank you for your response, first of all.
No, that doesn’t work either, this time it says file.toURL isn’t even a function.
Also, file.url is from this documentation snippet:
Granted, either of these scenarios SHOULD work, but they don’t. It’s as if I don’t have access to this new feature.
I had a file in my tmp folder, i wanted to store it in the file store and get it’s URL which will be handy as a placeholder in a presentation i’m making.