codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Open a file from website  foxon177 at 03:06 on Thursday, May 08, 2008
 

Open a file from website

Hello,

I'm trying to convert VB code to C++ code.

The VB code accesses a web site and opens the file in memory as follows :-

...
myFile = "https://...<filename>.txt"
Workbooks.Open filename:=myFile
...

My C++ code is as follows :-

...
fstream output;
output.open("https://...<filename.txt>", ios::in);
string temp;
while(getline(output,temp))
{
cout<< "Line: [" << temp << "]\n";
}

output.close();
...

The code works ok with a test file I created.

Can you please advise why I cannot open the file for reading in C++ ?

The file does not have specific permissions on it. In fact, when I enter the full https://... into my IE URL, I can see the file.

I tried putting \ before each / but this didn't help.

I managed to do: -

ShellExecute(NULL, "open", "https://...<filename.txt>",
NULL, NULL, SW_SHOWNORMAL);

But how can I iterate over the file, or even better copy it to my C: drive ?

Many thanks.

<Added>

http://www.webproworld.com/domain-discussion-forum/65469-good-registrar-asia-domain-name-registration-limited.html

http://hi.baidu.com/msdes








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  ** Site Hacked ** javascript inserted...
•  Losing background/text color when converting HTML to PDF
•  hidden div block when displayed, displays at an offset of 200px only in IE 6..
•  help - sketch
•  Re: Perl Script - File Handling.
•  Open a file from website
•  Re: to open 5 terminals from one and also execute different commands on each terminal
•  read a selected multiple line, those should match some of the values read in the files..
•  Help me please


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008