Scripts and configuration snippets are stored in no volatile directory.
/var/data/upload_wifi/
so you need to create the directory first:
mkdir /var/data/upload_wifi/
Now we need to create scripts which will handle switching OFF and ON the WiFi AP, when the STA will connect and disconnect.