2 Replies Latest reply: Jan 2, 2014 11:02 AM by S2154 RSS

How to get the size of the blob file uploaded ?

PraveenKM Newbie
Currently Being Moderated

Hi ,

Is there anyway to get the size of the file i have uploaded to a blob type attribute ?

What i can see is that when we upload a file in contributor UI ,once the file is uploaded successfully and if we hover on it , it will show the filename , type and size of the uploaded file .

From where can we get that details so that we can reuse these details in our code ?

 

 

Thanks and Regards,

 

Praveen

  • 1. Re: How to get the size of the blob file uploaded ?
    S2154 Newbie
    Currently Being Moderated

    I dont think there are any default option for geeting the file size. you have to write Filter class

  • 2. Re: How to get the size of the blob file uploaded ?
    pgleghorn Journeyer
    Currently Being Moderated

    A filter is a sensible solution, or you can get it in a roundabout way like this for example if you have the blobid (this is paraphrased from OpenMarket/Gator/AttributeTypes/IMAGEPICKERShowImages.jsp):

     

    <ics:sql sql='<%="select urldata,filevalue from MungoBlobs where id=" + ics.GetVar("blobid")%>' listname="blobdata" table="MungoBlobs" />

    <ics:listget listname="blobdata" fieldname="urldata" output="urldata" />

    <ics:setvar name="blobpath" value='<%=ics.GetProperty("cc.urlattrpath", "gator.ini", true) + ics.GetVar("urldata")%>' />

    <%

    File blobFile = new File(ics.GetVar("blobpath"));

    long length = blobFile.length();

    %>

     

    Phil

     

    Message was edited by: pgleghorn

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points