reset password
Author Message
victormejia
Posts: 40
Posted 14:09 Nov 18, 2010 |

In what directory are the files uploaded? I tried searching deep within the .metadata folder but can't seem to find it.


I wanted to make sure I'm correctly deleting and replacing.

HuanXue
Posts: 34
Posted 14:43 Nov 18, 2010 |

It's the path which you decided in build.properties

victormejia
Posts: 40
Posted 16:41 Nov 18, 2010 |

great thanks.


I'm not sure what I am doing wrong. I can delete from the database, but calling file.getDiskFile().delete() doesn't delete it from disk. Any ideas?

HuanXue
Posts: 34
Posted 17:04 Nov 18, 2010 |

I use the same way to delete but I don't know your own way to get that "file".

But if you are not deleting a folder on csns, I think you only need to make sure that you get the correct path, i.e. correct "basedir" & " id" & "version".

Phobe
Posts: 40
Posted 17:20 Nov 18, 2010 |

You can call getDiskFile() and check if the file exists and get the full path. Most likely the file won't exist.

I ran into a similar problem and found that fileDao.getFileById() returns the correct file object, but the baseDir isn't set. Once the baseDir is set correctly, it should point to the right file.

victormejia
Posts: 40
Posted 17:43 Nov 18, 2010 |
Phobe wrote:

You can call getDiskFile() and check if the file exists and get the full path. Most likely the file won't exist.

I ran into a similar problem and found that fileDao.getFileById() returns the correct file object, but the baseDir isn't set. Once the baseDir is set correctly, it should point to the right file.

Yea I am getting the same thing. All values are set correctly but when I try to retrieve the baseDir, it's null. How did you make sure it is set correctly?

victormejia
Posts: 40
Posted 17:48 Nov 18, 2010 |
victormejia wrote:
Phobe wrote:

You can call getDiskFile() and check if the file exists and get the full path. Most likely the file won't exist.

I ran into a similar problem and found that fileDao.getFileById() returns the correct file object, but the baseDir isn't set. Once the baseDir is set correctly, it should point to the right file.

Yea I am getting the same thing. All values are set correctly but when I try to retrieve the baseDir, it's null. How did you make sure it is set correctly?

I got it; once I get the it from the database I set the baseDir again. Not sure if it's correct but it works

kknaur
Posts: 540
Posted 18:34 Nov 18, 2010 |

If you look at your database Files table you will notice there is no basedir column unless you created it back when you altered the Files table.  Since this is the case, of course the basedir property would be null as there is no corresponding column to set that property.  As someone previously mentioned, it is necessary to set the basedir of the file object you want to save at upload time.