|
-
Jul 14th, 2001, 06:04 AM
#1
Thread Starter
Hyperactive Member
Gadnammit, This should work!
..I think...
Anyway, here's the story. I'm using the Inet Transfer control to upload a file to a remote server via FTP. When I use this line of code, the file uploads fine:
Code:
inetFTPTest.Execute , "PUT C:\ftptest\config\ftptest.bok /htdocs/ftptest.bok"
but when I attempt to use App.Path in this line, ie
Code:
inetFTPTest.Execute , "PUT " & App.Path & "\config\ftptest.bok /htdocs/ftptest.bok"
The file will not upload. Am I using App.Path incorrectly? Won't App.Path work with the Inet control?
Help Me Please!
Thanks in advance...
-
Jul 14th, 2001, 06:10 AM
#2
-= B u g S l a y e r =-
is App.Path the same as C:\ftptest ?
and do you get any errors ?
-
Jul 14th, 2001, 06:14 AM
#3
I don't think you are using the App.Path correctly.
Check for the Admin Path. I think. The App.Path is probably looking in your machine.
The C: is hardcoded in your source.
Let me know if that helps.
-
Jul 14th, 2001, 06:16 AM
#4
Are you doing error checking? if so what error are you getting also. try doing on the line before
MyTempFile = "PUT " & App.Path & "\config\ftptest.bok /htdocs/ftptest.bok"
inetFTPTest.Execute , MyTempFile
I Think this has happened to me and that fixed it
-
Jul 14th, 2001, 06:32 AM
#5
Thread Starter
Hyperactive Member
Newt, I've tried what you suggested, and it didn't work. Also, no errors are being returned, which makes me wonder what exactly is happening.
peet and Medicus, App.Path specifies the directory from which the program is being run, on my machine.
Any other ideas, Guys?
-
Jul 14th, 2001, 06:36 AM
#6
-= B u g S l a y e r =-
Originally posted by CyberSurfer
.... App.Path specifies the directory from which the program is being run, on my machine.
yes, i understand, I was wondering if the app.path might contain spaces or folders with more tha 8 chars ... something that differs from C:\ftptest
-
Jul 14th, 2001, 06:42 AM
#7
Thread Starter
Hyperactive Member
Good point. In actual fact App.Path is longer than 8 chars, and contains spaces. I just put C:\ftptest to save me typing out the whole path.
Does this tell you what I'm doing wrong?
-
Jul 14th, 2001, 06:47 AM
#8
-= B u g S l a y e r =-
Its just a thought, I'v experienced this kind of strange behavior when using the shell function. It doesnt give an error, and nothing happens ... like in your case.
just to make sure... move the exe to a folder like the one you used in the sample, and see what happens ...
huh.. Its a long shot, but what do you have to loose
-
Jul 14th, 2001, 06:49 AM
#9
-= B u g S l a y e r =-
also add a msgbox showing you the content of App.Path when running the exe....
-
Jul 14th, 2001, 06:53 AM
#10
Thread Starter
Hyperactive Member
Thanks peet!
The message box listes App.Path as
Code:
C:\Jonathans Bits n' Pieces\Visual Basic\Projects\Booking System
and the program worked when I moved the exe to C:\ftptest.
Any ideas how to get the program to work from directories including spaces et al?
-
Jul 14th, 2001, 06:57 AM
#11
-= B u g S l a y e r =-
try using " "
-
Jul 14th, 2001, 06:58 AM
#12
-= B u g S l a y e r =-
Code:
inetFTPTest.Execute , "PUT " & """" & App.Path & "\config\ftptest.bok & """" /htdocs/ftptest.bok"
-
Jul 14th, 2001, 07:02 AM
#13
Thread Starter
Hyperactive Member
Nope, that still doesn't work...
-
Jul 14th, 2001, 07:04 AM
#14
-= B u g S l a y e r =-
notice ...
I misplaced the last & """" at first.. I'v changed it....
if you already noticed... try single quot "'" instead ...
-
Jul 14th, 2001, 07:05 AM
#15
-
Jul 14th, 2001, 07:06 AM
#16
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 14th, 2001, 07:08 AM
#17
-= B u g S l a y e r =-
good Idea parksie
Code:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long
Public Function GetShortPath(strFileName As String) As String
Dim lngRes As Long, strPath As String
'Create a buffer
strPath = String$(165, 0)
'retrieve the short pathname
lngRes = GetShortPathName(strFileName, strPath, 164)
'remove all unnecessary Chr$$(0)'s
GetShortPath = Left$(strPath, lngRes)
End Function
-
Jul 14th, 2001, 07:08 AM
#18
Thread Starter
Hyperactive Member
Back in an hour...I'll try it then..
-
Jul 14th, 2001, 07:10 AM
#19
-= B u g S l a y e r =-
nice avatar parksie
-
Jul 14th, 2001, 07:12 AM
#20
Monday Morning Lunatic
Hehe thanks
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 14th, 2001, 07:15 AM
#21
Did everybody just get out of bed ?
Where the hell have you been when I was figthing for the Life of "oops, another one".
Arrrggghhh...
-
Jul 14th, 2001, 07:17 AM
#22
-= B u g S l a y e r =-
huh... Medicus ?? need help? ...
-
Jul 14th, 2001, 07:24 AM
#23
Well,
I called the freakin guy in India @ 1.75$ a minute.
Everybody needs help!
Don't make me start on this...
-
Jul 14th, 2001, 07:30 AM
#24
peet, I like you a lot.
Hey, I don't say that to everybody. Even if you are a female, I'll like you anyway...
Love xxx
Bert
-
Jul 14th, 2001, 07:35 AM
#25
-
Jul 14th, 2001, 07:42 AM
#26
Just keep your hands in your pants and everything will be ok.
-
Jul 14th, 2001, 07:44 AM
#27
-= B u g S l a y e r =-
what make you think I'm wearing any ??
-
Jul 14th, 2001, 07:49 AM
#28
Just your tone of voice and the fact that your are only using one hand.
-
Jul 14th, 2001, 08:56 AM
#29
Thread Starter
Hyperactive Member
Not being very familiar with the use of API and suchlike fun-ness, I'm not exactly sure what I'm supposed to do with GetShortFileName, and how it solves my problem. Any help?
-
Jul 14th, 2001, 09:09 AM
#30
-= B u g S l a y e r =-
Code:
dim sFTPCommand As String
sFTPCommand = "PUT " & GetShortPath(App.Path & "\config\ftptest.bok) & " /htdocs/ftptest.bok"
inetFTPTest.Execute , sFTPCommand
the GetShortPath function returns the path in the ~1 style 
eg c:\progra~1\myapp\app.exe
-
Jul 14th, 2001, 09:28 AM
#31
Thread Starter
Hyperactive Member
-
Jul 14th, 2001, 09:28 AM
#32
-= B u g S l a y e r =-
any time CyberSurfer
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
|