NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: John Fligg on February 20, 2012, 03:04:49 AM
-
The demo works great until you change the location of the file.
Here is my code in the web handler which I have changed ....
! self.site.UploadsPath = clip(self.site.WebFolderPath) & '\alternate'
self.site.UploadsPath = clip(self.site.AppPath) & '\somewhere' !\images'
and this is what is saved as the filename.
ewhere\PICT0036.JPG
If I use the WebFolderPath all works fine. However I cannot use that in a multi user scenario and need a specific path.
The above is only an example as I would not be using AppPath in reality.
BTW I note by checking the example data that someone has changed the path to "alternate" by uncommenting the code. This works great. I THINK that using anything but the WebFolder is an issue.
Thanks
John
-
Makes sense. Just use the clarion copy command after the file uploads and copy it where ever you want.
-
Hmm is that really safe? If you use the "common" web/uploads folder, what would happen if you got 2 files the same name?
I will be renaming the files using the record ID as part of that name but there is a chance that 2 users could post the same file in the upload folder at the same time.
The only way to limit that is to use the time in the filename I guess.
Thanks
John
-
bear in mind you can't turn around and _serve_ the pictures, unless they are inside the web folder somewhere.
Bruce
-
Not quite sure what you mean by _serve_ the pictures Bruce but this is a disaster for me (I think).
For multi users, do I now have to create individual user folders within the web folder itself????
Basically imaging is a big (huge) part of my app and every user is goint o have to store a lot fo their own images.
Thanks
John
-
example 40 shows how to serve files outside the web folder.
But this is a bad idea for security reasons - if you don't understand exactly what you're doing you can create a hole which malicious users can exploit.
>> For multi users, do I now have to create individual user folders within the web folder itself?
up to you. multiple folders, or unique names - both work fine.
>> Basically imaging is a big (huge) part of my app and every user is goint o have to store a lot of their own images.
So, what's your "disaster" - they'll be inside the web folder. they have to be somewhere, so they may as well be there.
cheers
Bruce
-
Sorry Bruce - a rather unprofessional response.
When you mentioned this I panicked and thought I could only have one folder. I have now created multiple user folders (as with the DATA) and all is working fine now.
Just that now when I create the user folder I have to do the same in the web folder. Not a problem, just one line of code in our office system.
BTW Any news on that FM3 issue?
Thanks
John
-
Bruce when you say "opening up a hole" - does that apply to DATA also???
Should everything go inside the web folder or are we just talking about images and the like?
Thanks
John
-
Does not apply to data, only -files- that will be served.