Project

General

Profile

Actions

Support #1035

closed

behavior of spoolFileName and clientFileName

Added by Anonymous over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
10/21/2011
Due date:
% Done:

0%

Estimated time:

Description

Hello:

I'm using the WFileUpload widget to allow a client to upload files to a server running windows xp. I'm seeing some behavior that I didn't expect, and am having trouble working around it.

1) Post-upload, my call to WFileUpload::spoolFileName() returns the truncated path "C:\DOCUME~1\Joe\LOCALS~1\Temp\wt-4D.tmp". Is there a way to get the full filename through wt?

If not, is there a way to set the default spool target directory through the Wt API or in wt_config.xml?

2) Post-upload, my call to WFileUpload::clientFileName() returns the filename portion of the upload file rather than the full path. (i.e. if the file upload widget contained C:\blah\file.txt the function call returns file.txt.) Is there a way to return the full path?

Many thanks

Matthew

Actions #1

Updated by Wim Dumon over 12 years ago

Hello Matthew,

1) See getTempDir() in src/web/Utils:

std::string getTempDir()
{
  std::string tempDir;

  char *wtTmpDir = getenv("WT_TMP_DIR");
  if (wtTmpDir)
    tempDir = wtTmpDir;
  else {
#ifdef WIN32
    char winTmpDir[MAX_PATH];
    if(GetTempPathA(sizeof(winTmpDir), winTmpDir) != 0)
      tempDir = winTmpDir;
#else
    tempDir = "/tmp";
#endif
  }

  return tempDir;
}

By default, we use the path as it is reported by getTempDir(), but you can override it by setting the WT_TMP_DIR environment variable.

2) This depends on the browser. This call returns what the browser has sent us.

Wim.

Actions #2

Updated by Koen Deforche over 12 years ago

  • Status changed from New to Resolved
  • Assignee set to Wim Dumon
Actions #3

Updated by Koen Deforche over 12 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.2.0
Actions

Also available in: Atom PDF