Support #1035

behavior of spoolFileName and clientFileName

Added by Anonymous over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:10/21/2011
Priority:NormalDue date:
Assignee:Wim Dumon% Done:

0%

Category:-
Target version:3.2.0

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

History

#1 Updated by Wim Dumon over 1 year 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.

#2 Updated by Koen Deforche over 1 year ago

  • Status changed from New to Resolved
  • Assignee set to Wim Dumon

#3 Updated by Koen Deforche over 1 year ago

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

Also available in: Atom PDF