I'm attempting something a bit unconventional.
I'd like to be able to call a a5w page and pass it a variable called "address". This page will then take the address and see if a folder of the same name is created on the webserver under /Photos/.
eg. http ://www.thesite.com/photos.a5w?address=20 cherry st
If the directory exists, it should display the images (jpg) that are in that folder. (/Photos/20 cherry st/)
Below is something I've come up with my limited abilities, it works perfectly on the localhost, but doesn't function on the remote side?!?.
The first problem is that won't create the directory on the remote server. Is there some other "path" command I'm missing, or should be using instead to get the current server path?
(Even if I create the path manually (on remote server), and place photos in it, the script doesn't see them...)!?
I'd like to be able to call a a5w page and pass it a variable called "address". This page will then take the address and see if a folder of the same name is created on the webserver under /Photos/.
eg. http ://www.thesite.com/photos.a5w?address=20 cherry st
If the directory exists, it should display the images (jpg) that are in that folder. (/Photos/20 cherry st/)
Below is something I've come up with my limited abilities, it works perfectly on the localhost, but doesn't function on the remote side?!?.
The first problem is that won't create the directory on the remote server. Is there some other "path" command I'm missing, or should be using instead to get the current server path?
(Even if I create the path manually (on remote server), and place photos in it, the script doesn't see them...)!?
Code:
<%a5 'Do the header ? "<font size='12'><strong>" + address + "</font></strong>" 'Figure out the source directory prefix into 'dr' dr="/photos/" + address + "/" temp=a5.get_path() + dr ? "<br>" cr="\photos\\" + address + "\\" create=a5.get_path() + cr 'If there is no directory with the address created, then create it. if file.exists(create) = .f. then file.dir_create_recurse(create) '? "<br>Directory Created!" end if ? "<br>" 'Grab the directory listing into ff, and ready to parse ff = filefind.get(temp + "\*.jpg", FILE_FIND_NOT_DIRECTORY, "N") ff = filter_stringc(ff,"a5wcmp",crlf(),.t.) ? "<br>" ? "<br>" i=0 ' prepare counter, in case there are none, (for message below) 'Print the output to display whatever jpg files are in the directory. for each foo in ff ? "<strong>"+foo+"</strong><br>" ? "<image src=\""+dr+foo+"\"><br><br>" i=i+1 ' count iterations next if i=0 then ' if there are no photos, then display the error message. ? "No photos uploaded for " + address end if %>
Comment