On Thu, Jan 28, 2010 at 5:47 AM, Graham Higgins <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On 27 Jan 2010, at 20:24, Graham Higgins wrote: > >> Okay, dokey, I'll give it a spin and confirm back that it does. > > > Yes, it does. > > I needed to make one or two simple changes and I've updated the bitbucket > repos: > > http://bitbucket.org/gawel/gpfileupload/ >
Hey cool. Thanks > Anyone who is working with Pylons tip and wants to try out this package, > see: > > http://bitbucket.org/gjhiggins/gp.fileupload-test/ > > I also have question in passing. > > If my development.ini fragment looks like this: > > [filter:fileupload] > use = egg:gp.fileupload > include_files = fileupload.css jquery.fileupload.* > tempdir = %(here)s/data/fileupload > max_size = 50 > upload_to = %(here)s/data/filestorage > > and uploaded files are being successfully saved to, e.g. > > %(here)s/data/filestorage/b1/89/a7/Snap001.jpg > and > %(here)s/data/filestorage/32/89/cb/Snap002.jpg > > what's the recommended means of accessing those generated pathnames from > within the controller? I was expecting to be able to pick it up from > request.environ but I can't seem to find it. > When you use upload_to, the original cgi.FileStorage is replaced. The new files stored in request.POST contain the relative file(s) path(s). You can then add a StaticApp(here/data/filestorage) and use /static/${path} to generate the file link in a template You can also use the Storage middleware to replace a response content like this: -- Content-Type: application/x-pdf /relativepathtoupload/file.pdf -- by the original uploaded file. See `exclude_paths` http://www.gawel.org/docs/gp.fileupload/storage.html#usage The middleware wil catch all non html content-type who does not match the exclude_paths. Then you don't have to change anything in your app code and can use repoze.what or whatever to secure the file access Regards, -- Gael > HTH > > Cheers, > > Graham > > http://www.linkedin.com/in/ghiggins > > > > > -----BEGIN PGP SIGNATURE----- > > iEYEARECAAYFAkthFuEACgkQOsmLt1Nhivw1dQCfYkA6ahKM2l1rTjcA79sTSnpj > Dc0AoLEheRWtRyP+tVwBBtFlgFdREfrFiQCVAgUBS2EW4VnrWVZ7aXD1AQJ1HgP/ > X3fzb5oxohA2uKQ88wHOAlfvcxC1Y02yWadvhxy8NSd5gM5BafVSzIGduVStDWLc > Ejczi7EAZiNQIqogx85RoFsVYyrwTjTZMlOXnvOqlWC7z3CFJrSLoxIUAT1fvEWO > ucLCF1X2xNiYpTdPWeNHiI3tdY6tm5H1il1dC1p8Pwo= > =+vA9 > -----END PGP SIGNATURE----- > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pylons-discuss?hl=en. > > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
