Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. opening a web file

opening a web file

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    doctorpi
    wrote on last edited by
    #1

    Hi guys If I have a file in a web place http:\www.myweb.com\text\myfile.txt Is there a simple way to do something similar to fopen("http:\www.myweb.com\text\myfile.txt", "rt") or it's impossible? Best Regards

    D R C 3 Replies Last reply
    0
    • D doctorpi

      Hi guys If I have a file in a web place http:\www.myweb.com\text\myfile.txt Is there a simple way to do something similar to fopen("http:\www.myweb.com\text\myfile.txt", "rt") or it's impossible? Best Regards

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Although I've never tried, I believe sockets is what you'll need (e.g., recv(), send(), connect()). If, however, you are using MFC, take a look at CFtpConnection::OpenFile().


      Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

      D 1 Reply Last reply
      0
      • D David Crow

        Although I've never tried, I believe sockets is what you'll need (e.g., recv(), send(), connect()). If, however, you are using MFC, take a look at CFtpConnection::OpenFile().


        Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

        D Offline
        D Offline
        doctorpi
        wrote on last edited by
        #3

        Thanks I'll take a look Dr.Pi

        1 Reply Last reply
        0
        • D doctorpi

          Hi guys If I have a file in a web place http:\www.myweb.com\text\myfile.txt Is there a simple way to do something similar to fopen("http:\www.myweb.com\text\myfile.txt", "rt") or it's impossible? Best Regards

          R Offline
          R Offline
          RaajaOfSelf
          wrote on last edited by
          #4

          I don't think you can do that directly ...You can try CHttpFile class in MFC which will help you ... Cause is my effort; Effect is God's effort

          1 Reply Last reply
          0
          • D doctorpi

            Hi guys If I have a file in a web place http:\www.myweb.com\text\myfile.txt Is there a simple way to do something similar to fopen("http:\www.myweb.com\text\myfile.txt", "rt") or it's impossible? Best Regards

            C Offline
            C Offline
            Chris Hills
            wrote on last edited by
            #5

            I did this sort of thing recently using class CInternetSession. Have a look at that. (And don't forget that any \s in a string have to be \\ )

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups