24/7 Support: 800.608.6482

Get Started

Developer Docs

file_read_bytes

MivaScript Builtin Function, Miva Merchant 9+

Tag / Description

file_read_bytes( path, location, offset, length, data )

<mvt:assign name="g.return_value" value="file_read_bytes( path, location, offset, length, data )" />

Reads a portion of the file specified by "path" and "location" into "data". Returns the number of bytes read, which may be less than "length", if an attempt was made to read past the end of the file, or -1 on error.

Parameters

  • path

    The name or filepath of the file to open relative to the directory specified by "location"

  • location

    One of "script" or "data"

  • offset

    The zero-based offset at which to begin reading

  • length

    The number of bytes to read. If < 0, the entire file after "offset" is read.

  • data

    The variable in which to store the file data

Return Values

Examples

Miva believes that all online businesses should have access to a scalable ecommerce platform that can meet their unique business requirements. Miva offers PCI compliant ecommerce, hosting, and custom website design and development solutions. Miva customers have processed over $100 billion in online sales since 1997.

Copyright © 2016 Miva, Inc - All Rights Reserved   Privacy Policy | Store Policy

Links
Contact Us
Receive Tips & Updates

Copyright © 2016 Miva, Inc - All Rights Reserved

Back To The Top