if (file.type.match(textType) && file.size<1000)
...this will only upload small files. Torrent files are around 9kb.
I mitigated the limit by...
set thelist to "0123456789ABCDEF"
set hexvalue to ""
repeat with i in ciphertext
set theAscii to ASCII number of i
set hexvalue to hexvalue & character (theAscii div 16 + 1) of thelist & character (theAscii mod 16 + 1) of thelist
end repeat
set finalText to (hexvalue as text)
set messageLength to the length of finalText
set var_a to messageLength / 4
set var_b to var_a / 200
set iterations to round var_b rounding up
set counter to 1
repeat iterations times
if messageLength is less than 800 then
set charnumberalpha to 1
set charnumberbeta to messageLength
else
set charmaximum to messageLength
if counter is equal to iterations then
set charnumberalpha to 1 + 800 * (counter - 1)
set charnumberbeta to charmaximum
else
set charnumberalpha to 1 + 800 * (counter - 1)
set charnumberbeta to 800 + 800 * (counter -1)
end if
end if
set messageFinal to (text charnumberalpha thru charnumberbeta of finalText)
if counter is less than 10 then
set identifierLength to 1
else
set identifierLength to the length of counter
end if
set completeMessage to identifierLength & "000" & counter & "000" & messageFinal
set urlMassive to "http://localhost:7874/nxt?requestType=sendMessage&secretPhrase=" & (stringValue() of secretPhrase) & "&recipient=" & (stringValue() of accountReceiver) & "&fee=" & (stringValue() of messageFee) & "&deadline=1440" & "&message=" & completeMessage
do shell script "open " & (quoted form of urlMassive)
set counter to counter + 1
end repeat
EDIT: I don't want the bounty BTW.