diff --git a/lookaside_upload b/lookaside_upload
index 4c5612a..05dfae4 100755
--- a/lookaside_upload
+++ b/lookaside_upload
@@ -80,8 +80,9 @@ checksum=$(sha1sum ${file}|awk '{print $1}')
 
 f_log "Checking if file already uploaded"
 local_size=$(stat -c %s ${file})
+http_code=$(curl -s -o /dev/null -w "%{http_code}" ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum})
 remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}|grep "Content-Length"|cut -f 2 -d ':'|tr -d [:blank:]|tr -d '\r')
-if [ "$local_size" -eq "$remote_size" ] ; then
+if [ "$http_code" -eq 200 ] && [ "$local_size" -eq "$remote_size" ] ; then
   f_log "File already uploaded"
   exit 3
 fi