473,657 Members | 2,763 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 2607
-----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
(imagecreatefro mjpeg, imagecreatefrom gif, imagecreatefrom png, 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)

iD8DBQFBbfjDgxS rXuMbw1YRAqEkAK CnONehj2RdP0dpF UZvGjLoC4KeRgCe N47d
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
9094
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 data, imports it into a mySQL database and deletes the .csv-file after the import. so far, so good. but in some cases the cronjobs starts running when the file is not completely
0
2210
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 replace the uploaded file with the new resized version) I get a "file being used by another process" error. I therefore cannot replace the uploaded image with the new thumbnail. How can I get around this???
4
13973
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 && location.protocol.toLowerCase() != 'file:' && navigator.javaEnabled()){ netscape.security.PrivilegeManager.enablePrivilege('UniversalFileRead'); }
2
2044
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 - post_max_size=8M and we have the <input type="hidden" name="MAX_FILE_SIZE" value="5000000"> input tag appearing prior to <input type="file"
11
3242
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 just display it below: The following code contains the script to process the uploaded file, the form to upload the file and then a few links to view the file from
11
3347
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 intact. A compiler's preprocessor won't do this, since it will also process macros defined in the code (and in standard header files) and strip out everything. For instance, given source like: #include <stdio.h> #if defined(AAA) void...
2
3990
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 below and of course it's not working properly because my web page which displays the resulting image from the database is not showing the image. I **think** the problem is in my converting the bitmap back to a byte array. If I change my code back...
2
1859
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 enable Zend on their php. I would like to have a way to check for a file to be a jpg or gif file in another way.
4
12612
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: <input id="biopic" name="biopic" type="file" />
2
1615
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 give the chmod permissions in FTP through fileattributes propery to upload folder it will give the message as Status: Set permissions of '/admin/upload' to '777' Command: SITE CHMOD 777 upload Response: 500 'SITE CHMOD 777 upload': command not...
0
8394
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, 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...
0
8306
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,...
1
8503
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,...
0
8605
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 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...
1
6164
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1615
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 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...

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.