|
-
Dec 10th, 2005, 04:39 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Inet "Put"; Space in name problem
Hi all,
I'm writing a program that has this line of code:
Code:
FTPInet.Execute , "Put C:\Program Files\ArbChat\CNs.txt ArbChat/CNs.txt"
I couldn't get it to work for ages, then I realised that the problem was "Program Files" - There's a space between the two, and it thinks that's the point that it needs to stop reading, and the next part is the file to be uploaded.
I tried using the age-old internet method of adding %20 instead of a space, but as this is a local file it doesn't seem to work. I tested it with exactly the same code, but "ProgramFiles" (without the space), and created the directory, and it worked fine.
Any ideas how I can tell it that the space is part of the filename?
Thanks ^_^
Last edited by BubbleLife; Dec 10th, 2005 at 05:40 AM.
-
Dec 10th, 2005, 05:57 AM
#2
Re: Inet "Put"; Space in name problem
Rather than figuring out how to tell it that a space is part of the file name, wouldn't it be easier to just move your text file to a folder location that did not have a space in the folder name?
-
Dec 10th, 2005, 06:01 AM
#3
Thread Starter
Addicted Member
Re: Inet "Put"; Space in name problem
Well, that was one option I considered.. I googled and forumum searched for quite a bit, checked out MSDN, etc but the only examples/threads i could find, either had no spaces or they couldn't figure out a way to fix it.
It's just, professional programs are stored in C:\Program Files so that's where i'd rather store it. Plenty of commercial and even home-created programs connect to the internet so it seems a shame if I can't get mine to
-
Dec 10th, 2005, 06:17 AM
#4
Re: Inet "Put"; Space in name problem
Already tryed this?
FTPInet.Execute , "Put C:\Progra~1\ArbChat\CNs.txt ArbChat/CNs.txt"
-
Dec 10th, 2005, 06:21 AM
#5
Thread Starter
Addicted Member
Re: Inet "Put"; Space in name problem
Yup, tried that, no dice T_T
Also tried making "C:\Program Files\ArbChat\CNs.txt" a variables and just doing
FTPInet.Execute , "Put " Var & " ArbChat/CNs.txt" and various things using the Chr(34)
-
Dec 10th, 2005, 06:54 AM
#6
Re: Inet "Put"; Space in name problem
 Originally Posted by Arby
It's just, professional programs are stored in C:\Program Files so that's where i'd rather store it. Plenty of commercial and even home-created programs connect to the internet so it seems a shame if I can't get mine to 
I would like to point out that this is not universally true.
I'm a commerical developer and when a customer installs whichever one of our products that they have purchased, our installation and setup program does not use Program Files. We create a folder off of the root of c:\ that is named the same as the purchased product. All of our software is then installed off of this folder.
I know other commerical developers in other companies, and pretty much their companies follow this procedure as well.
One of the reasons that we do not use Program Files is because of the space in the folder name.
Admittedly, however, there are many commerical companies (Microsoft being one of them of course) that do install all of their software off of Program Files)
-
Dec 10th, 2005, 07:09 AM
#7
Thread Starter
Addicted Member
Re: Inet "Put"; Space in name problem
I see.. Alright, I'll set it all to install to C:\ArbChat rather than Program files. I have seen/used/got programs that install to C:\, i just assumed that using the Program Files folder was universally standard.. for example, i have the vast majority of programs installed to Program Files, and that was the default install directory
Thanks anyway
-
Dec 10th, 2005, 08:50 AM
#8
Re: [RESOLVED] Inet "Put"; Space in name problem
 Originally Posted by Arby
Hi all,
I'm writing a program that has this line of code:
Code:
FTPInet.Execute , "Put C:\Program Files\ArbChat\CNs.txt ArbChat/CNs.txt"
I couldn't get it to work for ages, then I realised that the problem was "Program Files" - There's a space between the two, and it thinks that's the point that it needs to stop reading, and the next part is the file to be uploaded.
I tried using the age-old internet method of adding %20 instead of a space, but as this is a local file it doesn't seem to work. I tested it with exactly the same code, but "ProgramFiles" (without the space), and created the directory, and it worked fine.
Any ideas how I can tell it that the space is part of the filename?
Thanks ^_^
Try this:
VB Code:
FTPInet.Execute , "Put " & """C:\Program Files\ArbChat\CNs.txt ArbChat/CNs.txt"""
I think it will work for you.
-
Dec 10th, 2005, 09:52 AM
#9
Thread Starter
Addicted Member
Re: [RESOLVED] Inet "Put"; Space in name problem
Ah, I've switched my program to all write to C:\ now.. But I ran this code on my test app and it works! Thank you ^_^
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|