473,503 Members | 11,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

check if image is partially uploaded with ftp-software

Even if you upload an image partially with ftp software, you can still read
the image. Only the image will be partially gray.

So, can I determine with a php-function if an image is fully uploaded on the
server and without checking the filesize using an interval in time?

To be completely clear : this isn't about http-upload, but about uploaded
files with external ftp-software.

Thanks in advance!
Jul 17 '05 #1
1 2594
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

geradeaus wrote:
Even if you upload an image partially with ftp software, you can
still read the image. Only the image will be partially gray.

So, can I determine with a php-function if an image is fully
uploaded on the server and without checking the filesize using an
interval in time?

To be completely clear : this isn't about http-upload, but about
uploaded files with external ftp-software.

Thanks in advance!


Hi,
I'm not sure, but see if the Image functions that load image files
(imagecreatefromjpeg, imagecreatefromgif, imagecreatefrompng, and so
on) will return error codes on truncated image files. If they do,
just figure out what format the image was supposed to be in, try to
load it, and see if it works.

If not, I suspect you'd have to investigate image-format-specific
routines (i.e. roll-your-own JPEG checker, roll-your-own GIF checker,
and so on, which might not be too hard if you only use one or two
formats, but which would require you to understand the image formats
yourself).

Alternatively, if you're the only one uploading files, maybe you could
set something up so that partial files don't stay lying around
(either the server or the client sets some option to delete them if
they're incomplete).

Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBbfjDgxSrXuMbw1YRAqEkAKCnONehj2RdP0dpFUZvGj LoC4KeRgCeN47d
giwP+0CLIcLa/YKpx0nhQ30=
=PSpP
-----END PGP SIGNATURE-----
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
9071
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
0
2182
by: Mark | last post by:
Hi all, I want to be able to resize an image that a user has uploaded. I have the image upload working as well as the image resize. When I go to delete the original uploaded file (I want to...
4
13962
by: Gianpiero Colagiacomo | last post by:
Hi, I'm trying to use the following code (found online - can't remember where) to validate images being uploaded to my server: function checkImageUpload (fileName) { if (document.layers &&...
2
2011
by: SoSaucily | last post by:
I am getting the 'partially uploaded file' error with uploads over about 4k-5k. $_FILE = 3. Rackin my brain on this one, any help appreciated. Php.ini - upload_max_filesize=2M -...
11
3227
by: bissatch | last post by:
Hi, I am trying to upload an image, create a new file based on that image and then store the base64 encoded image data in a database. I dont really know where my code is going wrong so I will...
11
3317
by: Chris Croughton | last post by:
I have a requirement to partially preprocess C code. By 'partially' I mean that I need to define some macros (to the utility) and have it preprocess only those macros, leaving everything else...
2
3976
by: Brad | last post by:
I have code which takes an image, uploaded from a web page, and saves it to a database. Now I want to always resize an uploaded image before it is saved to the database. My code to resize is...
2
1842
by: Geoff | last post by:
Hi Previously I was able to check for an uploaded file to be a jpg or a gif by using the exif_imagetype() function. I had to change from hosting provider and the new one doesn't want to...
4
12591
by: lawrence k | last post by:
I've a file that starts like this: <form id="pdsForm" method="post" action="/mcControlPanel.php" class="mcForm" charset="UTF-8" enctype="multipart/form-data" > and it contains this input: ...
2
1610
by: swethak | last post by:
Hi, i wrote a code to upload a image.In my local it works fine. When i place this code in website through FTP. In that it will not works. i am giving the upload path ../upload . When i try to...
0
7212
marktang
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,...
0
7098
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...
0
7470
tracyyun
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...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
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 ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.