Apple (AAPL 0.74%) supplier SanDisk (NASDAQ: SNDK) has hit a wall. The flash-memory maker was trading at all-time highs going into second-quarter earnings, but dropped close to 14% after the report came out.  While SanDisk reported strong results and satisfied consensus estimates, its outlook left a lot to be desired. 

A woeful quarter
The company suffered as a result of constrained supply and a massive drop in average selling prices. In fact, SanDisk's average selling prices dropped a whopping 26% in the previous quarter, which was more than expected. As a result, its gross margin of 46% fell below the estimated 49%. Also, the company controlled supply too aggressively, so it didn't produce enough chips to meet demand.

SanDisk saw strong shipments during the previous quarter. Its gigabytes shipped jumped an impressive 51% from the prior-year period. As such, had the company gauged demand properly and kept its supply capacity up to the mark, it might have avoided issuing a weak outlook for the current quarter. SanDisk now expects revenue in the range $1.68 billion-$1.73 billion, which is below the consensus estimate of $1.74 billion.

Now, this is the quarter when the production of Apple's iPhone will ramp up, so a weak outlook from SanDisk was bound to take a heavy toll on its stock. Moreover, SanDisk's cost-control moves seem to have backfired. According to Wedbush Securities (via Reuters), overzealous cost control hurt SanDisk's ability to expand production capacity.

The drop is an opportunity
No doubt, SanDisk has shot itself in the foot due to improper inventory management. However, the company is still confident of delivering record results this fiscal year. This indicates that the previous quarter might be a minor hiccup. Moreover, there are a few solid reasons to continue betting on SanDisk and buying more shares on the drop.

SanDisk's margin took a hit in the previous quarter. Still, the company is confident of getting back on track, with gross margin expected in the range of 47%-49% in the current quarter. Once SanDisk improves its output and attains the demand-supply balance, its top line should get better. Although SanDisk is currently being criticized for not producing enough chips, it should be noted that controlled production will help the company mitigate the effect of falling average selling prices in the long run.

Long-term prospects still intact
As far as long-term demand is concerned, SanDisk has a lot of opportunity ahead of it. The company's flash memory is used in products ranging from computers to mobile devices to solid-state drives. In addition, it is expanding its portfolio to tap the enterprise storage market.

Last month, SanDisk announced the acquisition of Fusion-io, which develops flash-based PCIe hardware and software solutions, for $1.1 billion. Fusion-io's solutions are used to improve application performance in enterprise and hyperscale datacenters. SanDisk expects this acquisition to help it tap the fast-growing data center market by helping companies manage heavy data workloads and reduce ownership costs. 

This is a smart move by SanDisk, as the global data center construction market is expected to grow at a significant annual rate of 22% until 2018.

SanDisk is also well-positioned at Apple, as its flash memory and solid-state drives are used in both MacBooks and iPhones. In fact, SanDisk gets one-fifth of its revenue from Cupertino, but this number could rise as Apple is expected to go big with the next iPhone.  It has been widely reported that Apple will launch a 4.7-inch iPhone, along with a bigger 5.5-inch phablet.

According to Apple Insider, the phablet might be equipped with 128GB of memory. The use of a bigger memory in a fast-selling device will increase SanDisk's memory shipments, resulting in higher revenue. Also, Apple is reportedly producing the upcoming iPhone at a faster pace than previous generations. As Fool contributor Daniel Sparks points out, "initial orders for the new iPhone are twice those for the iPhone 5 (68 million units), according to Business Weekly."

Thus, SanDisk might see some tailwinds toward the back half of the year, which might have encouraged it to call for record results this year, despite a weak outlook for the current quarter.

The bottom line
SanDisk has disappointed investors, but at the same time, the stock's steep drop can be an opportunity to buy more shares. The company might see some short-term pain, but with improving production and strong end-market prospects, it can bounce back in the long run.