Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:27:03+00:00 2026-06-12T03:27:03+00:00

Question: how can I use an output file stored on the OpenCPU server as

  • 0

Question: how can I use an output file stored on the OpenCPU server as input to another function?

Background:
I am attempting to use knitr and markdown within openCPU to generate html that I can use to update a webpage with statistical information on the page load.

The basic workflow is as follows:

  1. Generate an .Rmd file, store locally.
  2. Access a webpage that uses AJAX to upload the .Rmd file to an OpenCPU instance on the server.
  3. Use the knit function via openCPU to turn the function into a *.md file stored on the server.
  4. Use the markdownToHTML function on the file stored on the server (by passing in the appropriate hash generated via the call to knit) and receive an AJAX reply that contains the generated HTML.
  5. Update web page with new HTML.

As it stands, I have this process working up to step 4. I can call knit passing in an .Rmd file via a form request POST, and I receive the following reply from OpenCPU:

{
"object" : "xa9eaea44e1",
"graphs" : [
    "xf31dcfe7f3"
],
"files" : {
    "figure" : "xfc55396fd8",
    "test.md" : "x7821c69f79"
}
}

where "test.md" is the output file generated via the knit function. Now, I attempt to use the hash (in this case "x7821c69f79" by POSTing to /R/pub/markdown/markdownToHTML/ascii with the following parameters:

file     /R/tmp/x7821c69f79/bin

This returns an HTTP 400 error with the following message:

cannot open URL 'http://localhost/R/store/R/tmp/x7821c69f79/bin/rds'

However, when I make a GET request to /R/tmp/x7821c69f79/bin, the contents of test.md are returned. So I know the file is being stored correctly on the call to knit.

So, what’s going on here? In other words, how can I use an output file stored on the OpenCPU server as input to another function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:27:04+00:00Added an answer on June 12, 2026 at 3:27 am

    Hmz the /store error looks like a bug, I’ll look into that.

    Maybe in step 3 you can have the function return the contents of test.md, e.g. end with return(readLines(test.md))? Or better yet, don’t output to test.md but to a tmpfile() and return the contents of that. This way the output is stored as an R object in the store, rather than a raw file, and you can just pass an argument e.g. file=x7821c69f79 in step 4.

    Did you have a look at the markdown example app? See source here and here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML Javascript question to get the selected value of a input-select I can use
I have a question that can I use AS400ConnectionPool in Spring if then pls
Brief question What command can I use to make my DataSet refresh it's connection
Have a rather simple question. Does anyone knows if i can use jparallax both
I'd like to use the html5 widget + it's api (http://developers.soundcloud.com/docs/html5-widget) My question: can
Well, question is in title. Is it possible at all? I can use css
I asked a question earlier about why left joins in Linq can't use defined
My question is, why I can not use hide() & show() to hide/show table
I ask a similar question here and Darin Dimitrov answer that we can't use
This question may be an absolute crap. Can i use the flex 4 sdk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.