demo_mail.begin_attachment(conn => conn,mime_type => v_mime_type_bin,inline => TRUE,
filename => filenm, transfer_enc => 'base64');
BEGIN
fil := BFILENAME(dirname, filenm);
file_len := dbms_lob.getlength(fil);
dbms_output.put_line('file_len is '||file_len);
modulo := mod(file_len, amt);
pieces := trunc(file_len / amt);
if (modulo <> 0) then
pieces := pieces + 1;
end if;
dbms_lob.fileopen(fil, dbms_lob.file_readonly);
dbms_lob.read(fil, amt, filepos, buf);
data := NULL;
FOR i IN 1..pieces LOOP
filepos := i * amt + 1;
file_len := file_len - amt;
data := utl_raw.concat(data, buf);
chunks := trunc(utl_raw.length(data) / MAX_LINE_WIDTH);
IF (i <> pieces) THEN
chunks := chunks - 1;
END IF;
demo_mail.write_raw( conn => conn,
message => utl_encode.base64_encode(data ) );
data := NULL;
if (file_len < amt and file_len > 0) then
amt := file_len;
end if;
dbms_lob.read(fil, amt, filepos, buf);
END LOOP;
dbms_lob.fileclose(fil);
END;
demo_mail.end_attachment(conn => conn );
END begin_attachment;
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE