|
Post by votan on Sept 30, 2008 4:10:20 GMT -5
first problem: I want to upload files directly to a given directory without storing them in the default dir first and moving them afterwards. But, if I add a path to the upload function, the full serverpath gets displayed in the upload-requester. Likeupload "Select a file to upload."; DefaultDir$;"\";file$ gets displayed asSelect a file to upload.c:\rbp\ what of cause is not really wanted. How can I surpress displaying the path??
Second problem: Everyone here seems to be using if file$ = "" then end for their upload requesters to end the routine if no filename got supplied. But this "if then" just get's ignored, as the fileupload itself already took place. So processing the filename (in this case file$) prior to uploading a file does not work. Is there a way to work with the filename before the upload took place? I want to validat a filename before the file actually gets uploaded.... so if file-extension is not valid, do not upload and return error. Right now it seems like I first have to go through the full upload and then have to verify filedata and delete the file again if that failed.
|
|
|
Post by Carl Gundel - admin on Sept 30, 2008 7:35:27 GMT -5
I guess the first question is, does the UPLOAD statement now work without a runtime error? I hope so.
Secondly, I agree that it does it makes sense to add the ability to specify an upload directory. I'll work on that.
As for using DefaultDir$ the way you demonstrate, you've discovered that doesn't work. The parameter is supposed to be a variable containing the filename that was uploaded.
Regarding validation, since this is a standard web widget I don't know if there's any way to add prevalidation to it. The UPLOAD statement is using functionality built into the browser to do its work. Perhaps there is some way to do something smarter, but off the top of my head I don't have an answer for that. Is this a serious issue for your application, or just an annoyance?
-Carl
|
|
|
Post by votan on Sept 30, 2008 7:43:49 GMT -5
The upload seems to work fine so far.... It's not a really bad issue that I can preprocess the filename before actually uploading.... it just sux to upload a huge file just to get an error "filetype not supported" Preprocessing the filename would just speed such things up tremendously. The bigger issue indeed is, that I can't change the path of the upload without seeing it in the upload requester.... but great to hear that you will work on that. So I'm sure it will be fixed.
|
|