View Full Version : Attachment Paths

08-19-2011, 06:26 PM
I have a browser form in which items can be checked off for receipt by email. They may be images, PDFs or other file types. When submitted to the cgi app on the server I seem to have it all working with one exception. I can't figure out how to specify the path for the selected files.

I'm using $files = array("fileone.ext","filetwo.ext")

My database is running via cgi.bin so the challenge (for me) is how to insert the path to the files which are in the sub-directories of the root. I know their locations, it's the format in my PHP array that eludes me.

Would it be array("/images/fileone.ext","/docs/filetwo.ext") ?

08-19-2011, 08:00 PM
$_SERVER['DOCUMENT_ROOT'] contains the path on the server to the web root for your site.

So if the files are web accessible then this would work as a path:


08-19-2011, 11:07 PM
Thanks, that's what I needed.