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

  • SEARCH
  • Home
  • 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 6591123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:23:06+00:00 2026-05-25T17:23:06+00:00

The Situation: Imagine two servers A and B. Server B just outputs a PDF

  • 0

The Situation:
Imagine two servers A and B. Server B just outputs a PDF file that nicely displays information retrieved from any xml string passed to it via a url parameter. Server A’s job is to build an xml string, append this xml string onto a url (pointing to the code on Server B) as a parameter, and then call the url using php’s readfile() function…

The Question:
Is there a way to do the same thing (readfile on remote server and output to browser) in TCL?

  • 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-05-25T17:23:07+00:00Added an answer on May 25, 2026 at 5:23 pm

    If your script is doing output on its stdout channel (or pretending to) then you can use some extra tricks of Tcl’s http package so that you keep the data in the OS layer rather than dragging it through your code directly:

    package require http 2
    
    set url "http://example.org/getpdf/fromxml"
    set data "<example>this might be your xml</example>"
    
    # Generate headers, based on example from PHP readfile() page
    puts "Content-Description: File Transfer"
    puts "Content-Type: application/pdf"
    puts "Content-Disposition: attachment; filename=example.pdf"
    puts "Content-Transfer-Encoding: binary"
    puts "Expires: 0"
    puts "Cache-Control: must-revalidate, post-check=0, pre-check=0"
    puts "Pragma: public"
    # No content length; data streamed from elsewhere
    puts "";    # End of headers!
    
    set tok [http::geturl $url -query $data -type text/xml -channel stdout]
    # You ought to check for errors here I suppose...
    http::cleanup $tok
    

    This is assuming that the fetch from the remote host is a POST so default handling of the -query option is suitable. Since we’re sending a body in our request, it’s not a GET (and it’s definitely not a PUT…)

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

Sidebar

Related Questions

imagine a situation where you have an application that needs to import data from
Imagine a situation, I have PC with two lan cards, one is connected to
Imagine the following situation: I have two branches: DEV and MAIN. I'm working on
Situation: I have a simple XML document that contains image information. I need to
Trying to found some information about Android app life cycle. So imagine the situation:
Lets imagine my situation (it's fake, of course)... I have web-site that have 1000
Let's imagine the situation: Two PC software , two development team, two different technology
Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
Situation: text: a string R: a regex that matches part of the string. This
imagine there are two interfaces arranged via composite pattern, one of them has a

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.