I’m developing a site with some functionalities I’ll not be going to explain here, because it’s not needed!
My question is a sort of abstraction of the real problem, anyway if you can answer me to that I’ll be ok:
Can I make, in MODx, a page where a form with a single field (local path of an image file) is shown, making the visitor upload as a resource, that will be displayed in my MODx manager?
Thank you!
-
☆ A M B ☆
- 24,524 Posts
I’m a little uncertain of exactly what you are trying to do. If you mean that you want the user to be able to upload an image into the assets/images directory so that you can then access the image via a TV or the Rich Text editor’s image selection, yes. It can either be a plain old HTML file upload or a fancy AJAX/Flash uploader. Personally, I’m rather fond of "Uploadify", and have used it several times.
For the AJAX processing, create a snippet and use a resource (document) with no template and only the snippet tags in the content. Use that resource URL as your AJAX processor. That way you have the usual access to all of the MODx API functions and don’t have to start a session.
http://www.php.net/manual/en/features.file-upload.post-method.php
http://www.uploadify.com/what-is-it/
-
☆ A M B ☆
- 24,524 Posts
I forgot about that...I suppose I should finish the tutorial one of these days.
Thank you both. Very useful.