Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local data = ...
- rednet.open("back")
- rednet.send(10,"","UPLOAD")
- local senderId,message,protocol = rednet.receive("CONNECTED", 10)
- if protocol == nil then
- print("Error establishing connection to database")
- elseif protocol == "CONNECTED" then
- local file = fs.open(data .. ".lua", "r")
- local fileData = {data, file.readAll()}
- file.close()
- rednet.send(senderId,fileData,"DATA")
- senderId,message,protocol = rednet.receive("SUCCESS", 10)
- if protocol == nil then
- print("Upload status check timed out")
- elseif protocol == "SUCCESS" then
- print("File successfully uploaded to database")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement