I am trying to upload a file (MP4 or MOV) to a custom folder, I need to access the original file not one served by php. I edited the File upload but can't seem to get it to save in my custom folder. Is their something Im missing or a elgg feature that disables this from happening? I'm on elgg 1.12.
$target_dir = $_SERVER['DOCUMENT_ROOT'].'/mysite/uploads/videos/';
$target_file = $target_dir . basename($_FILES["upload"]["name"]);
move_uploaded_file($_FILES["upload"]["tmp_name"], $target_file)
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- adrew22a@drew22a
adrew22a - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- adrew22a@drew22a
adrew22a - 0 likes
You must log in to post replies.Just don't do it.
If you insist, use data directory, and not public paths.
And you have to consider colliding filenames. Also, you won't be to map files to users, or take any of the advantages that come with using ElggFile.
I was going to name the filenames as the entity guids, so I can easily link them to the entity. Then only allow mov or mp4 for uploads. What are the issues I can run into doing this using your method data directory?
There are plenty of issues you will run into, especially if you are not familiar enough with Elgg.
Why don't you use latest Elgg version?
Current hosting supports up to 5.4 php and. Edited quite a few plugins... lack of time to move it and troubleshoot.