As simple as it sounds, I do some writing to a file and then close it. Afterwards I run FilePrint[foo]
but nothing shows up when running on the cloud, whereas when running on desktop, it does.
Ideas?
EDIT
Here's the code. It's silly though.
CloudDeploy[FormFunction[ {"Image" -> "Image", "Scale"->"Number" },
Module[{},
x=#Image;
r = #Scale;
ig = ColorConvert[x, "Grayscale"];
str = OpenWrite["imgg.txt"];
CloudExport[x, "JPG", "file"];
x = Part[ImageDimensions[ig], 2];
y = Part[ImageDimensions[ig], 1];
kx = 2 r;
ky = r;
sx = x/kx;
sy = y/ky;
chars = {" ", ".", ",", ":",";","-","=", "+", "*","x", "#","%","X", "@"};
f[z_] := chars[[Length[chars] - Floor[(Length[chars] - 1) z/255]]];
Do[
Do[
WriteString[
str,
f[
N[
Mean[
Mean[
ImageData[
ImageTake[ig, {kx*j, kx (j + 1)}, {ky*i, ky (i + 1)}],
"Byte"]]],
3]]],
{i, 0, sy}]
WriteString[str, "\n"],
{j, 0, sx}];
Close[str];]&, AppearanceRules -> {"Title" -> "IMG-2-ASCII"}]]
The following is a sample input and a sample output (image and the content of the file respectively).
Input
Output
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::::::::::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::::::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-=+**xxxxxxx+=-;;;;;;;:::::::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=*#%%%%%%%%%%%%%%%#x*+=-;;;:::::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-*#%%%%%%%%%%%%%%%%%%%%%%%#=;;:::::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*%%%%%%%%%%%%%%%%%%###%%%%%%#-;;::::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-#%%%%%%%%%%%%%%%%%##%%%%%#%#%%*;;;:::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;=#%%%%%%%%%%%%%%%%%%%%%%%###%#%%%=;;;::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;-#%%%%%%%%%%%%%%#xx**++++**x###%%%x;;;::::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;;x%%%%%%%%%%%%x+-;;;;;;::;-+x##%%%%%x;;;:::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;;x%%%%%%%%%%%#+;::::::::::::;-x##%%%%%=;;;::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;;+%%%%%%%%%#%%x-;;;;;:::::::::;;-*%%%%%x-;;::::::::::
;;;;;;;;;;;;;;;;;;;;;;;;=#%%%%%%%%%%%%x=;;;;;::::::::::;;=#%%%%%+;;;:::::::::
;;;;;;;;;;;;;;;;;;;;;;;;x%%%%%%%%%%%%%#+-;:::::::::::::;-=+%%%%%x-;;:::::::::
;;;;;;;;;;;;;;;;;;;;;;;=%%%%%%%%%%%%%%#+--;;::::::;-++**+==*%%%%+-;::::::::::
;;;;;;;;;;;;;;;;;;;;;;-*#%%%%%%%%%%%%#x##%%#x=;::;;+x#%xx+;-##%%=;;;:::::::::
;;;;;;;;;;;;;;;;;;;;;;-x#%%%%%%%%%%%#x#x*x*=*=-;::;----;:;;-*%%%=;;;:::::::::
;;;;;;;;;;;;;;;;;;;;;;+##%%%%%%%%%%%#+-;;;;;---;::;;::::::;-;x%#-;;::::::::::
;;;;;;;;;;;;;;;;;;;;;-*x%%%%%%%%%%%%x=;:::::;;;;::::::::::;-+#%x-;;::::::::::
;;;;;;;;;;;;;;;;;;;;;*x#%%%%%%%%%##%x=;;::;;;;;;:::::;;::::;x%x=-;;::::::::::
;;;;;;;;;;;;;;;;;;;-x##%%%%%%%%%%%%%*=-;;;--;;--;;::::;--;;;x%+-;;:::::::::::
;;;;;;;;;;;;;;;;;;;+#%%%%#%%%%%%%%%%*=--==--;;;;;;;;;==:;;:=%+=;;::::::::::::
;;;;;;;;;;;;;;;;;;;x%%%%%%%%%%#%%%%%#+----=x*---;;:::=;::;+x-;;;:::::::::::::
;;;;;;;;;;;;;;;;;;=%###%%%%%%%%%%%%%%%*=;-;-==-;:::;;:::;*x=;;;::::::::::::::
;;;;;;;;;;;;;;;;;;x#x##%%%%%%%%%%%%%%%%x+-;;;---;;;;::::=+*;;::::::::::::::::
;;;;;;;;;;;;;;;;;-x##%%%%%%%%%%%%%%%%%%x*+=;;;::::::::::-----;;::::::::::::::
;;;;;;;;;;;;;;;;;**#%%%%%%%%#%%%%%%%%%%#*++=-;;::::::::;-::;---;:::::::::::::
;;;;;;;;;;;;;;;;+xx#%%%%%%%%%%%%%%%%%###x+==--;;;;;;;:::;-;:;;;;:::::::::::::
;;;;;;;;;;;;;;;+###%%%%%%%%%%%#xxx**##x**+=-;;;:::::::::::=+;::::::::::::::::
;;;;;;;;;;;;;;+##%%%%%%%%%%%%#+=x#x*=+==-----;:::::::;:::::=#-:::::::::::::::
;;;;;;;;;;;;-*##%%%%%%%%%%%%#*+==---:---;;;;;::::::::;::;;::=%+;:::::::::::::
;;;;;;;;;;;=x#%%%%%%%%%%%%%x=--;;;;-;:;:::::::::::::::::;;;;:-#=;;:::::::::::
;;;;;;;;;-+%%%%%%%%%%%##%%*=;;;;;:;;-:::::::::::::::::::;;;;;;-#-::::::::::::
;;;;;;;;-x%#%#%%%%%%%%*#%*-;;;::::::;;:::::::;;;:::::::::;;;;;;-#+;::::::::::
;;;;;;;=x##%####%%%#x%*%#=-;;;:::::::;;;;::;::::::::::::::;;;;;;=%x;:::::::::
;;;;;;=**####**#%%x=-%%%x=-;;;::::::::-::::::::::::::::::::;:::;;+%*::;::::::
;;;;;=+=*x#x**x%%x=--#%%+-;;;;;;;;;;;-+;-;;;::::::::::::::::::::;;*%+::::::::
;;;;;==*xx+==*%%x=-;+%%#=--;;;;;--;-=xx=+;;-;::::::::::::::::::::;-#x;::::;;;
;;--+*x*==-=*%%x=--+###x=----------=*#*-**--=;-=*=;:::::::::::::::;*=;::;:;;;
:==*x#=--;=+x%%*-;-x#xx*-----------=*#*-*##%%xx+*%X;::::::::;::::::=-=;:::;;+
Do[ ... {i, 0, sy}]
and the expressionWriteString[str, "\n"]
. That's bound to be causing trouble although I don't fixing it will solve your problem. $\endgroup$