ODBiC Discussion Board


RE: Upload File error, Max Steiner, 04-20-2006

That means that the CGI doesn't have write privileges for the directory

by Roger Harris, April 20, 2006 14:30

The file name ".\upload2" would mean that the file is on the "current working directory," which depends on your Web server. That error means that the user ID that ODBscript is running under doesn't have write privileges for that directory. (This would be the privileges granted under the local Windows file system, not directory options configured in the Web server, which only control how a directory may be accessed with HTTP requests that go through the server.)

So, first you will need to determine where the working directory is, and one easy way to do that is to create a script that just has an <% EXEC DIR %> command, which will perform a DOS directory listing of the current working directory. Then, you need to set the Windows permissions on that directory to allow writing by all local users (or, if you know the specific user ID that the server uses to run CGIs, then just for that user ID). If you are running on a commercial host that doesn't allow you to have direct sessions on the host machine but does provide a Web-based site maintenance utility, there will usually be a function for setting file system privileges for your site's directories. If not, then your hosting service probably pre-configured at least one directory to allow writing by CGIs, so you will need to use that directory (by adding a hidden input to the upload form named "upload_dir").

Alternatively, you can omit any directory reference from the upload file specification, and ODBscript will default to using the temporary directory defined by the Web server. (The name of this directory will be in an environment variable named TMP, so $env("TMP") will give you the directory name.)


Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.