Hi, Ive been pulling my hair on this one -- who hasnt. Im encoding a jpg using the JPGEncoder and the same code that is out there on the internet.
AS: -
var jpgSource:BitmapData = new BitmapData (sw, sh);
-
jpgSource.draw(root);
-
var namae:String = TITLE.replace(/[\s]/g, "-");
-
var jpgEncoder:JPGEncoder = new JPGEncoder(90);
-
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
-
var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
-
var jpgURLRequest:URLRequest = new URLRequest(URL+"download.php?name="+namae+".jpg");
-
jpgURLRequest.requestHeaders.push(header);
-
jpgURLRequest.method = URLRequestMethod.POST;
-
jpgURLRequest.data = jpgStream;
-
navigateToURL(jpgURLRequest, "_top");
-
PHP: -
if (isset( $GLOBALS["HTTP_RAW_POST_DATA"])) {
-
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
-
header('Content-Type: image/jpeg');
-
header("Content-Disposition: attachment; filename=".$_GET['name']);
-
echo $jpg;
-
} else {
-
echo "An error occured.";
-
}
-
for some reason, I seem to be the only one in the world who this happens to. About half the time, the image appears as half rendered. Youll see half the stage fine but the other half looks likes its still being drawn out. Ive seen it still green, magenta, gray, all the colors of the rainbow. When I try to load the image in photoshop, it says that the image is corrupted. Im stuck using CS3 for right now, so I still have to bounce downloads off the server. Can anyone offer any insight? I cant tell if its the actual byteArray or if its on the server side. I have no idea where to start to debug this. Please someone help me!
Thanks in advance!!
0 1395 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: deko |
last post by:
I need to allow users to download files from a directory that is not
publicly accessible. To do this, I use a download script:
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".$filename);
readfile($fullpath);
I've also tried using header("Content-Type: application/force-download")
instead of header("Content-Type: application/octet-stream"), but get the
same results - the downloaded...
|
by: Vinay |
last post by:
Hi
I have a corrupt word file. I am able to open it with the code given below
tr
Dim pInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo(
pInfo.UseShellExecute = Tru
pInfo.FileName = "c:\corrupt.doc
Dim p As Process = System.Diagnostics.Process.Start(pInfo
Catch ex As Exceptio
MsgBox(ex.ToString
End Tr
|
by: Filips Benoit |
last post by:
A particular form - always the same - sometimes becomes corrupt after
saving.
Error msg =
The expression On Open you entered as the event property settings produced
the following error:
A problem occurred while 'DB-name' was communicating with the ole server or
ActiveX controle.
The form has a calendar-controle.
I have eliminated the code in the OnOpen-event but the form stays corrupt!
|
by: Bungle |
last post by:
Hi There,
Does anybody know where i might be able to locate a tool/application that
can determine whether a Database is corrupt??
Also, can a bad network connection cause a corruption to a database?
Thanks in advance for any help,
Bungle
|
by: dixie |
last post by:
I have come across some code to walk through the records of a corrupt table
and copy it record by record to a new table. It comes from the MVPS.Org
site and is as follows.
-----------------------
(Q) How can I recover records from a corrupt table?
(A) First, using Access while in the database window, copy the table's
structure only from the corrupt table, if possible. Then using the code
below, copy each individual row from the old...
| |
by: apoorv |
last post by:
Hi guys,
I am writing a imaging aplication on VC++.I have to display images and
apply effects onto it.Images could be of any type like
jpg,gif,bmp,psd...
I am using createDibSection API.it requires BITMAPINFO struc as one of
its parameters.Its working well(Images are successfully displayed) but
my problem is that in certain images(of any type)they are skewed and
becomes B/W(means Data corruption).U can see my code of populating...
|
by: Fredo |
last post by:
I have an app that I'm writing to manage jpgs. Sometimes the photos are
corrupt. If I use something like ACDSee, it will show the image, but it will
have a note in the status bar that the image is corrupt, and it says,
specifically, "The source datastream is corrupt."
I'd like to be able to detect this as well with C#, but the Image.FromFile()
method returns the image and I can't see any way to determine if it's
corrupt. Is this simply...
|
by: eventuranza |
last post by:
For my application, there users can upload and download files to the a
webserver. Straightforward enough. However, when they upload a PDF
file then try to download it, the file seems to be corrupted. The had
not been a problem before but it seems to have been introduced when I
refactored the writing to the response to a buffered version to prevent
potential OutOfMemoryExceptions (you wouldn't believe the size of some
of these...
|
by: rdemyan via AccessMonster.com |
last post by:
One of my users had a corrupt front end that wouldn't open.
My app is launched using a launching application (logon app). The logon app
has a button for downloading a "fresh" copy of the front end from the server
to the user's PC. I thought that this was a good idea since Access seems
susceptible to corruption.
I told the user to open the logon form and click the "Download" button, which
would then replace the corrupt front end on his...
|
by: iheartvba |
last post by:
Hi this is a query made using access query builder:
SELECT tblBank.BankID, Now() AS TimeRecd, Val(Right(nz(,0),3)) AS ConsID, "AutoCASH" AS RecUser, tblBank.Dt, Forms!frmRecCASHRunningBal!tbGroup AS GroupID
FROM tblBank
WHERE (((tblBank.Dt)>(!!-1) And (tblBank.Dt)<(!!+1)));
1.tblBank has a record in the Dt field which equals = 02/07/08
2. tbBankMinDate -1 = 01/07/08
3. tbBankRecDate + 1 = 03/07/08
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |