upload file to specific location.

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

upload file to specific location.

#1

Postby xren » Wed Oct 23, 2013 6:27 pm

Hi,

I would like to upload file to a specific location. and overwrite the existing one if a file already exist with the same name.

ufs/share/image/test/

How to setup the directory dynamically and setup overwrite option before uploadFileFromBrowser()?

I tried

var opts = new UploadOptions();
opts.directory = "c:/temp";
opts.maxFileSize = "5M";

But it complains that the UploadOptions is not defined.



Thanks,
Xiaoli
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Oct 24, 2013 7:34 am

UploadOptions was introduced in V4.5. Which Ebase version are you running? Incidentally using jQuery autocomplete (previous post) is much easier with V4.5 as you don't have to set up an integration service and call it via Ajax.

Regards
Jon
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Thu Oct 24, 2013 2:01 pm

Hi Jon,

I am using v4.4.2.

Can the overwrite be set somewhere

Has the pessimistic lock bug been fixed in verson 4.5?

If I install version 4.5 can my code be migrate directly without any change?

Xiaoli
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Thu Oct 24, 2013 4:07 pm

Code: Select all

Can the overwrite be set somewhere
A: No, not in V4.4. The only option is to upload and then copy or move the file to another directory.

Code: Select all

Has the pessimistic lock bug been fixed in verson 4.5?
A: Yes.

Code: Select all

If I install version 4.5 can my code be migrate directly without any change? 
A: Yes, but you should test it before releasing to your production system
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#5

Postby xren » Thu Oct 24, 2013 4:15 pm

How about FileService.copyFile() or FIleService.moveFile()

Do they have the option of overwrite file if it already exist?

If yes how to set it?

Thanks,
Xiaoli
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#6

Postby Jon » Thu Oct 24, 2013 4:37 pm

I think the answer is no, but you should check the javadoc for these methods for a definitive answer. You also have FileServices.existsFile() and FileServices.deleteFile() so you should have enough to handle all scenarios.
0 x


Who is online

Users browsing this forum: No registered users and 26 guests