spyre
spyre copied to clipboard
Multi app file uploading bug
I have multiap with "Home" site on route "/" and also "UploadFile" site on route "/uploadFile",
after uploading via button on site with route other than "/" there is no trigger on storeUpload
this is caused because in view.html file in line 498 there is hardcoded ajax attribute url: '/upload',
when i change this into url: '/uploadFile/upload',
I'm having trigger working fine.
please implement some functionality for replacing this url attribute with proper route
Also tested in scenario when I made in "Home"
def storeUpload(self, file):
UploadFile.upload_file = file
UploadFile.upload_data = file.read()
in UploadFile I moved parameters upload_file and upload_data as class attributes.
but this is pure hacking...
I solved problem by changing line 498 from file view.html url: '/upload'
into url: '{{prefix}}/upload',
and changing class attribute prefix now I have full control (for "/" no change ) but this requires prefix attribute to start with "/" for example prefix="/uploadFile"