Kbase P94747: Error uploading file using FTP with VB script in the WebSpeed generated HTML page
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/11/2004 |
|
Status: Unverified
FACT(s) (Environment):
WebSpeed 3.x
WebSpeed 2.x
SYMPTOM(s):
Unable to upload file using FTP
FTP upload achieved using the VB script
HTML page with VB script is generated by WebSpeed SpeedScript
The VB script reports error after the upload attempt
The error message from the VB script displayed in the browser:
The file C:\winnt\dirnameFilename.ext could not be saved on server
The error does not happen with all clients.
The SpeedScript contains:
[non relevant code removed]
{&OUT} ' l_c_FileNameLong = ':U {&FILE_ACCESS_ID} '.GetFilePath() + i_c_FileName ':U {&X_SKIP}.
{&OUT} ' if ':U {&FILE_ACCESS_ID} '.Upload("':U get-cgi("HTTP_HOST":U) '", "':U l-c-FtpWorkAlias '", l_c_FileNameLong) = 0 then ':U {&X_SKIP}.
{&OUT} ' msgbox ("':U + 'The file "':U + ' + l_c_FileNameLong + ':U + '" could not be saved on server':U + '") ':U {&X_SKIP}.
CAUSE:
The VBscript function used 'GetFilePath()' does not add the trailing slash to
the file path location causing incorrect path reference:
C:\winnt\dirnameFilename.ext
FIX:
Modify the VB script 'GetFilePath()' function, or the way it is being called, so that
there is no missing trailing slash preventing the successful file upload:
{&OUT} ' l_c_FileNameLong = ':U {&FILE_ACCESS_ID} '.GetFilePath()':U + {&X_SKIP}.
{&OUT} ' If Right$(l_c_FileNameLong,1) <> "':U + CHR(92) + '" Then ':U + {&X_SKIP}.
{&OUT} ' l_c_FileNameLong = l_c_FileNameLong & "':U + CHR(92) + '" ':U + {&X_SKIP}.
{&OUT} ' End If ':U + {&X_SKIP}.
{&OUT} ' l_c_FileNameLong = l_c_FileNameLong + i_c_FileName ':U + {&X_SKIP}.