Mailexample.sql how do you determine the file type?

I'm using the mailexample.sql which explains how to use the demo_mail wrapper package for utl_smtp. There's a procedure for attaching text files and a procedure for attaching binary files. I've got binary files to attach to email successfully.
How can I determine the file type so that I can use the attach_text procedure when attaching text files rather than the procedure for attaching binary files?
Sandy

Watch out! I think there is a bug in that code :-
bug with PL/SQL Sample - maildemo.sql
To answer your question - the usual way of determining a file type is to look for 'magic numbers' in the file that indicate its type. For example, Windows exe files often (always?) begin with the two letters 'MZ'. Zip files begin with 'PK'; Rar archives begin with 'Rar!'. Text files can begin with anything, and do not have any characteristic marker, but USASCII7 (which is what the format that routine is designed for - I think), is a characterset that only uses the first 7 bits of the byte. You could read the file, and if you find any bytes > 127, then you know it is not a USASCII7 file. I have seen various programs that 'sample' the first 64 or 256 bytes of a file instead of reading the whole file, and they usually get it right.
Hope this helps.
Takmeister

Similar Messages

  • HT1391 How do you change the file type on music downloaded?  It errors out when I try to sync to Sony Walkman.

    Can you redownload purchases with a different file extension?
    I can not download to a Sony Walkman - errors out

    Ia6Fan wrote:
    Can you redownload purchases with a different file extension?
    I can not download to a Sony Walkman - errors out
    All music downloads from the iTunes Store come in AAC format.  There is no choice.
    You can do either of the following:
    Buy the AAC and convert it per these instructions: 
    iTunes 11 for Windows: Save a copy of a song in a new file format
    OR
    Purchase your songs from a retailer who sells MP3s, such as Amazon MP3.

  • How do you determine the optimal size for Mozilla Firefox?

    How do you determine the optimal size for cache in Mozilla
    Firefox? I am using Firefox 7.0.1 on a 64-bit Windows 7 Ultimate operating system with 3GB RAM and 300 GB hard drive, but I have other computers running Windows XP. If the answer doesn't apply to all current versions of Firefox on all supported Windows operating systems, please explain the differences. Is there a formula for calculating the best cache size?

    I found that the best idea is to let Firefox decide that itself.

  • How do you determine the firmware version for a laptop docking station?

    How do you determine the firmware version of a HP docking station?
    Laptop Model: HP 2740p
    OS: 64bit Windows 7
    Expansion Base: 2740 Ultra Slim Expansion Base WA995AA#ABA
    Thank you for any assistance.
    Alvin

    atenpo wrote:
    How do you determine the firmware version of a HP docking station?
    Laptop Model: HP 2740p
    OS: 64bit Windows 7
    Expansion Base: 2740 Ultra Slim Expansion Base WA995AA#ABA
    Thank you for any assistance.
    Alvin
    WA995AA#ABA shows to be a hard drive, not a docking station

  • How do you determine the picture that is shown on iTunes for your podcast?

    How do you determine the picture that is shown on iTunes for your podcast? Is that done in iWeb or Garagetunes?

    That is a supported format,
    Pull the battery while the device is ON, replace after a minute, Let the device reboot 1-3 min,
    see if the problem is fixed,
    If not we may have to reload the device OS to get back the missing option.
    Thanks,
    If you need more info please ask!  If not please resolve the thread using the options by the Kudos’ star, Just place the check in the Post that answered your question, Thanks
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • HT3847 how do you determine a file is "empty"?

    I have somehow duplicated all my iTunes files... thereby taking up valuable space on my harddrive. This was caused by moving my iTunes "music, etc" back to the harddrive after using an external HD for a long time.
    I have read the article saying something about files being in "ITunes Media", rather than just "iTunes". So, it seems that I should just be able to remove all duplicates that have the path without "iTunes Media".  HOWEVER, I am not able to find the FOLDER called "iTunes Media" on my harddrive... which seems it should be in the "Music" folder. 
    Any guidance would be appreciated.
    Thanks.

    deb from sd wrote:
    HOWEVER, I am not able to find the FOLDER called "iTunes Media" on my harddrive... which seems it should be in the "Music" folder. 
    The iTunes Media folder is located in the /Music/iTunes/ folder.
    Everything in iTunes is in /Music/iTunes/ folder.
    deb from sd wrote:
    I have somehow duplicated all my iTunes files... thereby taking up valuable space on my harddrive. This was caused by moving my iTunes "music, etc" back to the harddrive after using an external HD for a long time.
    How did you "move" the files?

  • How do you Determine the Largest Size/Fastest Speed Hard Drive

    In general, how do you determine the maximum hard drive size/speed you can upgrade to?

    As long as the drive your are considering physically fits as already stated there is no maximum size you can install. Please complete your profile so we know what machine you have.
    If your machine is covered by a warranty or AppleCare I would recommend against installing another HD as this may invalidate the warranty. I would recommend in that case using a Firewire 800 external HD instead.
    Regards,
    Roger

  • HT1222 how do i determine the file size of each download before i download it?

    How do i determine the file size of a down load before i download it?

    I have checked the update page and even checked more and can find no reference to file size.  I'm using a hotspot and some of the downloads cause me to go over my limit and incur extra charges.  I apperciate your help.

  • HT201209 How do you determine the funds left on an itunes card?

    How do you determine the funds left on an itunes card?

    If it hasn't been redeemed, the value is the face value.
    If it was redeemed, the value on the card is zero. 
    When you redeem an iTunes gift card, the full value is immediately transferred as a credit to the account you are using when you do the redemption.  After that point, the card is worthless.

  • How do you get the files to play continuously?

    How do you get the files to play continuously? I created multiple slide shows in IPHOTO. I added them to IDVD and I cannot get them to play one right after another. Instead it goes to the main menu after each slide show.

    Did you add them all at the same time into the slideshow area?
    First, click on the + sign on iDVD's main menu, then select 'Add slideshow' and put all of them into the drop area. Now they will play continuously.
    Here is a visual image from Old Toad that shows multiple videos in the slideshow drop so they will play one after the other, but it is the same for your slideshows:
    http://homepage.mac.com/toad.hall/.Pictures/Forum/iDVD8movieSS.png

  • Newbie stuck - how do I change the file type of a photo I am formatting from a TIFF to a JPG?

    I am new to Aperture and struggling to figure out some of the basics, even with the tutorials.  I need to submit a photo for an art competition - the master is a TIFF and I need a JPG under 1.8 MB - how do I change the new version's file type and keep it with the master?
    Thank you in advance.

    I can't recommend the method proposed by Carolyn Samit; in fact, I recommend ignoring it.
    Aperture is large, complex, and can take some time to learn to use.  It is also quite powerful, and can handle nearly all -- or all -- common tasks you throw at it.
    I have written a very short guide to Aperture which was intended to provide some firm footing for those getting started.  I humbly suggest that you start with a quick review.
    One of the things that presents a bit of disorientation for new users is that, in practice, Aperture keeps your pictures in a kind of limbo.  There are good reasons for this -- suffice it for now to accept that you import image-format digital files into Aperture, you use Aperture to organize and optimize these as Images, and then when need a file to use outside of Aperture, you export you Image.  It is at export that you format your Image: you select the file type, the compression amount, the file name, the file size, and more.
    In your case, then, you will export your Version, and set the file type to TIFF (recommended above JGP whenever quality is paramount). There is no way to know the file size in bytes prior to creating it.  Start with a full-size TIFF and, if necessary, knock it down by percentage until the exported file is less than 1.8 MB.
    There is no reason to attempt to keep this file with the Image in Aperture.  Send it on its way.  Any time you need another file from your Image, you can create it fresh via "File→Export→Version".
    HTH.  If it doesn't, ask more. 
    Message was edited by: Kirby Krieger -- expanded a bit.

  • How do you move the files?

    How do you move all files related to my movie from the computer hard drive to the external hard drive without having to relocate the files in FCE. Also, where would you move the files to? pelase as much details as possible. thanks.

    Move the contents of the Final Cut Express Documents folder (in "Documents") to the external. You will have to reconnect no matter what, sorry.

  • How do you display the file "kind" e.g. .wav, aiff, etc  on the information bar on iTunes

    I'm new to apple and just successfully ripped a CD to iTunes in apple lossless. How do I get iTunes to display the music file type? I'm using an older upgraded hand me down early 2008 macbook pro.
    Thanks !
    Jim

    I use an older iTunes version but I can select "kind" in the view options window to get the file type to show.  However, I am not sure if they have changed this in recent iTunes since others mention using "kind" to switch between audiobooks, podcasts, etc. which mine definitely does not fo.

  • How can you determine a file creation date and know if it's been altered since the creation date

    I need to know how to determine a file creation date on an ipad.  If someone creates a document/note on an ipad how can you tell when it was created and if it has been altered since?

    Unless you are using a third party app that provides that functionality, in iOS the only thing youcan access is the last edit/save date and time, which is fairly evident in the user interface for documents and notes. Some apps that handle MS Office files may provide that, but ican't say first hand.

  • How do you determine the article ID from the long guid filename format?

    It would be very useful sometimes to determine the article Id number from the guid name or to get the guid name from the
    article ID number.
    Sometimes a log error references a guid name. Which isn't too bad because you can go to the distribution point and look through the folders and or install the contents.
    The other way around, finding a specific update from a list of guid number folders can be a bit of a job.
    Thanks

    I put together this SCCM admin console query:
    I set the Querys object Type :  <unspecified>  
     then I pasted in this:
    SELECT SMS_SoftwareUpdate.ArticleID,
    SMS_SoftwareUpdate.BulletinID
      FROM SMS_CIToContent
      INNER JOIN SMS_SoftwareUpdate
      ON SMS_CIToContent .CI_ID =SMS_SoftwareUpdate.CI_ID
    Where SMS_CIToContent.ContentUniqueID =##PRMMS_CIToContent.ContentUniqueID##
    I patched this together from several sources, but was largly able to retain my ignorance about the how and whys of
    Extended WQL and its join syntax. It seems very similar to SQL, (from which its derived, I'm told), but you can't just type in SQL code and expect it to work.
    I thought you might know of a media source for learning and using  WQL and Extended WQL?
    Thanks

Maybe you are looking for