You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add the uploader component to GB, but when using it inside of GB it does not work. The file is not uploaded and the following exception is thrown:
┌ Error: 2024-05-31 14:08:13 Error processing file: Base.IOError("open(\"/var/folders/h_/l8hxc31x73s97400gprpwnr80000gn/T/jl_Yxe327A5U9\", 0, 0): no such file or directory (ENOENT)", -2)
└ @ Main ~/genie/mwes/CSVUploader/app.jl:19
It works fine when running the app from the terminal outside GB.
Here's the code I'm testing with:
using GenieFramework
@genietoolsconst FILE_PATH =joinpath("public", "uploads")
mkpath(FILE_PATH)
@appbegin@onchange fileuploads begin@show fileuploads
if!isempty(fileuploads)
@info"File was uploaded: " fileuploads
notify(__model__,"File was uploaded: $(fileuploads)")
filename = fileuploads["name"]
tryisdir(FILE_PATH) ||mkpath(FILE_PATH)
mv(fileuploads["path"], joinpath(FILE_PATH, filename), force=true)
catch e
@error"Error processing file: $e"notify(__model__,"Error processing file: $(fileuploads["name"])")
end
fileuploads =Dict{AbstractString,AbstractString}()
end
upfiles =readdir(FILE_PATH)
endend@page("/", "app.jl.html")
I'm trying to add the uploader component to GB, but when using it inside of GB it does not work. The file is not uploaded and the following exception is thrown:
It works fine when running the app from the terminal outside GB.
Here's the code I'm testing with:
The text was updated successfully, but these errors were encountered: