我在下面使用代码:
a= input()
b= 0
c= len(a)
d= {"a":1, "b":2, "c":3, "d":4, "e":5, "f":6, "g":7, "h":8, "i":9, "j":10, "k":11, "l":12, "m":13, "n":14, "o":15, "p":16, "q":17, "r":18, "s":19, "t":20, "u":21, "v":22, "w":23, "x":24, "y":25, "z":26, " ":0}
for i in range(c):
b= b+d[a[i]]
print(b)
,但有时无法正常工作,图像无法存储。我使用heroku作为主机。
答案 0 :(得分:0)
尝试使用Storage
门面:
$path = \Storage::putFile('images', $request->file('image'));
Laravel将自动生成一个名称,关于Storage Facade,请参见this。 :)
答案 1 :(得分:0)
我设置了上传文件的功能,如果没有上传的文件,请再次执行直到上传完成为止
$imageFile->move($destinationFolder, $fileName);
if(file_exists(public_path('images') . '/' . $fileName))
return public_path('images') . '/' . $fileName;
else
self::uploadImage($imageFile, $fileName);