2017년 7월 6일 목요일

Duration of files on customtinyweb and firebase


I would like that the files uploaded to both accounts have an specific duration, how can I do this?

My tags in firebase dont need to exist for more than 4 hours and my files in my customtinydb can exist for 1 month or so (I dont need more than this period of time).

--
Try Taifun's FTP extension: puravidaapps.com/ftp.php
--
I've been reading the info getting in your link but I don't find anything useful to me.
What I want is to manipulate the duration of the files in my customtinydb web and my firebase account, and I think I should do it in Google Cloud Plattform and in Firebase web. I'm the admin so I should be able to configure my web.
Anyway thanks for your answer Nico.



-- 
If you are deploying a custom TinyWebDB, then you can make the eviction criteria anything you want by changing the corresponding Python code. If I recall correctly, for the default shared instance we keep the most recent 10,000 keys and as people write new pairs the older ones are deleted. As for Firebase, the Firebase component does not provide any mechanism for doing this. You may be able to set up a job in Firebase or via another service to go through and clean up files that are too old (or meet whatever criteria you like).


-- 
Thanks Evan for your answer.

I've been checking Python and I didn't find exactly what I was looking for, maybe It's my fault. Anyway I feel like this is out of my league, I mean, I finished a curse of appinventor and i did it because I didn't need the use of commands. Seems I need the use of them to configure the customtinydb and I don't know how to do it. I could use a tutorial for noobs.
I think it's a bit weird that you can't manipulate the life of a tag in Firebase, I'm using a bucket there for a little online gaming so in fact it should be delete right at the end of it. (well maybe Firebase was made for another purposes).



-- 
Any data you put into FirebaseDB with AI2  can be deleted, just write over the pertinent Tag with blank data   or clear the Tag .   There are blocks to do this.  The developer would  use an event handler to clear or overwrite the tag.    If you want the 'files uploaded to both accounts (to) have a specific duration you might be able to 'erase' them from Firebase (but not the TinyWebDB) using the Firebase Console from your PC -- yes you would have to log in and delete the tags manually and not automatically..

You might  use a Clock and a Tag in the Firebase to keep track of when a file starts and when it should become 'stale'.  Check the 'stale' tag on Screen1.Initialize and if it is stale, overwrite it?  or continuously use a Clock in the app to check for 'stale' and if stale delete.  This will not be simple coding.   If you have to have BOTH TinyWebDB and FirebaseDB in use simultaneously, you could do something similar with the TinyWebDB.

You should be able to do something with a TinyWebDB too.  Not necessary to use a TinyDB to check if a 'file' is stale because a Tag in either a TinyWebDB or FirebaseDB could keep the data.  

Your app, your logic.    Look in the forum for examples of how to keep a high score ... the stale data could be handled the same way.  Also look in the forum for Clock examples.   ..and Try to code something but make it a separate test Project before you include it in your fantastic app (so you do not inadvertently mess up its coding).


Regarding "it should be delete right at the end of it. (well maybe Firebase was made for another purposes)."     If you want the file to delete at the end of the game (?), then instruct the DB to overwrite or clear the Tag.  The Tag will not disappear when the app is left by turning off the Android.  If you have an exit button, use that to clear the Tag perhaps.

Here are some potentially useful lings from Abraham's FAQs




--
You will need to keep track of upload datetime and last used datetime for each file.


-- 
Thanks for the answers and the info.

I think I can manage well the Firebase tags with your tips. I'm not still sure about the tags in my customtinydb though because there's no block about clearing tags in tinyweb component.
I got the idea of storing the date of the uploaded file and I could compare it with the current date. 
According to this link 
it's possible to delete a tag in the customtinydb just using the storing block for tinyweb with the same tag and the value "delete". I have tried it and it's not working for me I dont know why.
It says exactly 

Storing a tag with the special value *delete* deletes the entry with that tag.

This could be the answer, can someone tells me what I'm missing right here?


-- 
Have you tried    *delete*  rather than delete  on the TinyWebDB?



-- 
I've tried a lot of them : *delete*, *Delete*, delete, Delete, deleteentry, /deleteentry, etc.

This is the source view

<h3>Store a tag-value pair in the database</h3>
<form action="/storeavaluemethod="post"
enctype=application/x-www-form-urlencoded>
<p>Tag: <input type="textname="tagsize="30"/></p>
<p>Value: <input type="textname="valuesize="30"/></p>
<input type="hiddenname="fmtvalue="html">
<input type="submitvalue="Store a value">
</form>
<br/>

<table border=1>
<tr>
<th>Key</th>
<th>Value</th>
<th>Created (GMT)</th>
</tr>
<tr>
<td>test</td>
<td>hola</td>
<td><font size="-1">July 3, 2017, 6 p.m.</font></td>
<td><form action="/deleteentrymethod="post"
enctype=application/x-www-form-urlencoded>
<input type="hiddenname="entry_key_stringvalue="agtlfnRpbnk0bGFuZ3IXCxIKU3RvcmVkRGF0YRiAgIDAyMWMCQw">
<input type="hiddenname="tagvalue="test">
<input type="hiddenname="fmtvalue="html">
<input type="submitstyle="background-color: redvalue="Delete"></form></td>
</tr>

</table>
</body></html>


It seems like there's an action called "deleteentry" but there's no block for it, just the "Delete" button in the customtinyweb to remove the tags manually.
If I were good with java programing maybe I could make an extension with that "/deleteentry" action.

-- 
Well I finally made it, now I can remove tags in my customtinydb. What I did was to download the zip "alltags-deletable-tinywebdb-fall14.zip" that can be get in this link:


and use it instead of the sample code offered here: 


It's important to type *delete* in the "value" side of the tinywebdb.storevalue block.

Now I have to figure out how to make users to delete the stale files.



-- 

댓글 없음:

댓글 쓰기