Is it possible to upload a file to Pipedream via HTTP POST, then send it on to Google Drive?

Hi all, I’m a complete newbie to both Pipedream and HTTP programming in general.

I have a data logger with a very limited operating system (it can only do HTTP GET, POST, and PUT requests), and I want to upload data (really small .csv files, < 1 MB) from this to Google Drive. Unfortunately, the API is very complex, and I can’t use OAuth2 from the logger to generate the necessary tokens in order to connect successfully to Google Drive.

I found this guide online for uploading a file to Google Drive using Pipedream: Upload File - Pipedream. What I’d like to do is adapt this, so that I first send a file via HTTP Post to the Pipedream Trigger URL, which would then send it on to a folder on Google Drive. Can this be done, and if so how?

Hi @jsa13,

To achieve your goal of uploading a .csv file from your data logger to Google Drive using Pipedream, you can follow these steps. This solution involves creating a Pipedream workflow that triggers on an HTTP request and then uploads the received file to Google Drive.

Step 1: Create a new Pipedream workflow

  1. Sign in to your Pipedream account.
  2. Create a new workflow.
  3. Add an HTTP / Webhook trigger. This will be used to receive the .csv file from your data logger.

Step 2: Add the “Upload File to Google Drive” action

After setting up your trigger, you’ll add an action to upload the file to Google Drive:

  1. Click the “+” button below your trigger to add a new step.
  2. Search for the “Google Drive” app and select it.
  3. Choose the “Upload File” action.
  4. You’ll be prompted to connect your Google Drive account.
  5. Configure the “Upload File” action:
    • File: Use the variable that represents the binary data of your file from the trigger step. This might be something like steps.trigger.event.body.
    • Folder: Specify the folder ID where you want to upload the file. You can find this in the URL when you open the folder in Google Drive.

Step 3: Send your file to the Pipedream workflow

With your workflow configured, send a POST request from your data logger to the HTTP trigger URL of your Pipedream workflow. The body of this request should contain the .csv file you wish to upload.

Example Code

Since you’re new to HTTP programming and might need a more detailed example, here’s a simplified version of what the Pipedream component code might look like. Note that this is a conceptual example to help you understand the process:

import { axios } from "@pipedream/platform"

export default defineComponent({
  props: {
    google: {
      type: "app",
      app: "google",
    },
  },
  async run({ steps, $ }) {
    // Assuming the file is sent as binary data in the request body
    const fileContent = steps.trigger.event.body;
    const folderId = "YOUR_FOLDER_ID_HERE"; // Replace with your actual folder ID

    // Upload the file to Google Drive
    return await axios($, {
      method: "POST",
      url: `https

I'm a bot powered by Pipedream and GPT-4. I'm still learning, so please double-check my answers and code! [Learn how to build your own](https://pipedream.com/blog/build-your-own-chat-bot-with-openai-and-pipedream/).