We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

RE: [Users] OC3.0 file upload problem

Thank you for reporting this. It turns out it isn't necessarily the
time zone that is causing the problem. The issue lies in + signs used
in the name of the uploaded file.
I uploaded a file called Frozen+Locked.doc, and when I try to download
it from OpenClinica I get the error page as well.
I am going to mark it as a known issue and we will be looking into
resolving the problem.
Paul J. Galvin
Project Manager
Akaza Research
~ OpenClinica Enterprise ~ Ask me about professional training, support,
and services for OpenClinica
-----Original Message-----
[mailto:[email protected]] On Behalf Of Gopal V
Sent: Wednesday, October 28, 2009 8:41 AM
To: [email protected]; [email protected]
Subject: [Users] OC3.0 file upload problem
Congrats on OC3.0, I am trying out the new features of the product,
during which i found a small bug. In this release there is a new
feature to upload files (images/pdf etc) as part of a form. We can
define a item with response type of 'File' in the eCRF design excel
During upload the file gets uploaded properly with a file name
appended with time stamp. (In my case it is in Indian Standard Time
IST so +0530), that is if i upload a image called myfile.jpg it gets
uploaded as myfile20091028155939+0530.jpg when i view the form it
shows the file name properly, but if i click on the link to view the
image, i am getting the error (Error page of Open Clinica).
On analyzing the log file and the source code i find that in the file
UploadFileServlet (line number 109 to 115) within
org.akaza.openclinica.control.submit package the following piece of
code which generates the timestamp that gets appended to the file name
(to make it unique i guess). In this the "Z" appends the timezone
information also.
class OCFileRename implements FileRenamePolicy {
public File rename(File f) {
// here, File f has been validated as a valid File.
String pathAndName = f.getPath();
int p = pathAndName.lastIndexOf('.');
String newName = pathAndName.substring(0, p) + (new
SimpleDateFormat("yyyyMMddHHmmssZ")).format(new Date()) +
return new File(newName);
Hence i am getting the file name as myfile20091028155939+0530.jpg but
when i try to view the file the '+' character is not part of file name
and hence OC throws an error saying cannot find the file. It is
actually searching the file "myfile20091028155939 0530.jpg". Please
not the space instead of '+'
I guess during the request the '+' becomes a space.
Can we remove the 'Z' (time zone info) from the unique file id
generation logic, and just have the 'yyyyMMddHHmmss' alone ? I guess
this would solve the problem and not disturb the unique id generation
part also.
This discussion has been closed.