Hi, I am facing some problems while doing this programming task in my project. When I upload any file from browser using "Admin" account. Then file uploaded successfully and I can see this file from browser also. Similarly When I check the path "/var/www/owncloud/data/admin/files/myfile" then my file is also present there. Fine.... Now important thing is that I made some changes in that file. Mean to say I go to the path and made some changes in that file and save it with new name in same path where currently uploaded file is present. What I want to achieve? I just want to see this updated file in that path rather than original one. Mean I want to delete the original file. But I am not being shown the new updated file from the browser. How can I do this?
Directly changes means if we make some amendments for the benefit of user, then we need to re-upload the updated file from the "/var/www/owncloud/data ".
Hi, Actually m doing this programmaticaly. We write the following code in 'upload.php' file, when a file is uploaded, then at that time according to following code we first go (not physically, rather through programming) in the database of logged in user, and then made some changes in that file according to our desired situation(discussed already). We achieved this task successfully and a new file is also created successfully. The code is give below:
For example: user upload a file with name "abc", and file saved to user database as ownCloud does, then according to above code we go to the path of user database, and made some changes and new updated file is created in that data folder "/var/www/owncloud/data/$UNAME/files/newfile" . Now when I am seeing in the browser I am only original file "abc", I need only to show the "newfile",
How to upload "newfile" on the same upload action called on uploading the original file??
My understanding of how Owncloud works is that you should not modify files directly (outside of the interface) as the file's metadata stored in the db won't get updated.
Can't you just make the changes to the file and then reupload it through Owncloud's webdav interface?
Thanks for response, In my case, it is necessary to make new file, so that's why I am doing this. If I deleted my original file, that will complete my 20 % task. But how can I re-upload new updated file from already called upload action?
You can use WebDAV for the task, you can run a file scan after the action or you can do it inside an ownCloud App (in which case you would also use WebDAV endpoint).
Hi, Please refer me towards exact point. I know that there is a piece of code need to be add up in "upload.php" file. But don''t know what is the code and don''t know where to write the code in uplaod.php file. Let''s suppose the file is present in the data folder, $file=/var/www/ownCloud/data/admin/files/fileB
Now what is the code to upload this file, (keeping in mind that in the same folder there is fileA, so need to delete fileA and replace with fileB). Important thing is that the upload event is already called to upload fileA so on the same action we have to write the code to replace fileA with fileB.